From 26014279855da98af7abecbbe045826091dfc454 Mon Sep 17 00:00:00 2001 From: Copilot Date: Thu, 30 Jul 2026 08:25:38 -0500 Subject: [PATCH 1/3] fix: scorer.sh --update-queue overflows argv on large function counts jq --argjson entries "$(...)" passes the entire scored-entries JSON as a single argv string. At swkotor.exe's queue scale (12,845 functions with per-entry score/reason/metrics), this payload is multi-megabyte and exceeds the OS argv-size limit, hard-failing with "Argument list too long" -- this silently aborted the autonomous vacuum/repair campaign's queue-scoring step before it could run, discovered when a full-queue --autonomous run exited after only 15/15 stage-resume receipts with no vacuum activity at all. The same script already uses the safe pattern (--slurpfile reading from a temp file, avoiding the argv limit entirely) three lines above for the same kind of large-array plumbing -- this just applies it to the second call site that didn't. Verified: reproduced the exact "Argument list too long" failure with the old --argjson approach against a realistic ~3.6MB synthetic entries payload (12,845 entries), confirmed the --slurpfile fix runs cleanly against the same payload and produces correct merged/scored queue output. --- scripts/scorer.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/scorer.sh b/scripts/scorer.sh index 0aded2b9..a82f6df5 100755 --- a/scripts/scorer.sh +++ b/scripts/scorer.sh @@ -63,7 +63,8 @@ if [[ ! -d "$prompt_root" ]]; then fi entries_tmp="$(mktemp)" -trap 'rm -f "$entries_tmp" "$queue_tmp"' EXIT +report_entries_tmp="$(mktemp)" +trap 'rm -f "$entries_tmp" "$queue_tmp" "$report_entries_tmp"' EXIT queue_tmp="" if [[ -n "$queue" && -f "$queue" ]]; then @@ -120,11 +121,12 @@ if [[ "$update_queue" == true ]]; then "$ROOT/scripts/lib/queue-state.sh" init --queue "$queue" --prompts-dir "$prompt_root" >/dev/null jq '.' "$queue" >"$queue_tmp" fi - jq --argjson entries "$(printf '%s\n' "$report" | jq '.entries')" ' + printf '%s\n' "$report" | jq '.entries' >"$report_entries_tmp" + jq --slurpfile entries "$report_entries_tmp" ' .pending = ( .pending | map(. as $p - | ([$entries[]? | select(.name == $p.name)] | .[0]) as $s + | ([$entries[0][]? | select(.name == $p.name)] | .[0]) as $s | if $s then $p + { score: $s.score, From ae50e0ee0f9c0c50c99cb3c780d425edb1a94948 Mon Sep 17 00:00:00 2001 From: Copilot Date: Thu, 30 Jul 2026 08:35:06 -0500 Subject: [PATCH 2/3] fix(review): create report_entries_tmp lazily inside --update-queue Mirrors queue_tmp's existing pattern -- both temp files are only used inside the --update-queue block, so both should be lazily created there rather than unconditionally near the top for every scorer.sh invocation. Found by code review (ce-code-review, 6 personas); no correctness impact, just avoids a needless mktemp on every non-update-queue run. --- scripts/scorer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/scorer.sh b/scripts/scorer.sh index a82f6df5..2f80f073 100755 --- a/scripts/scorer.sh +++ b/scripts/scorer.sh @@ -63,9 +63,9 @@ if [[ ! -d "$prompt_root" ]]; then fi entries_tmp="$(mktemp)" -report_entries_tmp="$(mktemp)" trap 'rm -f "$entries_tmp" "$queue_tmp" "$report_entries_tmp"' EXIT queue_tmp="" +report_entries_tmp="" if [[ -n "$queue" && -f "$queue" ]]; then jq -r '.pending[]?.name' "$queue" | while IFS= read -r name; do @@ -121,6 +121,7 @@ if [[ "$update_queue" == true ]]; then "$ROOT/scripts/lib/queue-state.sh" init --queue "$queue" --prompts-dir "$prompt_root" >/dev/null jq '.' "$queue" >"$queue_tmp" fi + report_entries_tmp="$(mktemp)" printf '%s\n' "$report" | jq '.entries' >"$report_entries_tmp" jq --slurpfile entries "$report_entries_tmp" ' .pending = ( From 2161b7ea5a0d1ac6e6f76326c43cf15b29459ea2 Mon Sep 17 00:00:00 2001 From: Copilot Date: Thu, 30 Jul 2026 08:54:28 -0500 Subject: [PATCH 3/3] fix: remove unused .state.now import (pre-existing CI lint failure) Pre-existing on master, unrelated to this branch's scorer.sh fix -- inherited from the base commit. Fixed here since it was blocking this PR's ruff CI check. Same class of pre-existing lint issue fixed independently on several other branches this session. --- src/agentdecompile_recovery/source_parity_synthesize.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/agentdecompile_recovery/source_parity_synthesize.py b/src/agentdecompile_recovery/source_parity_synthesize.py index 482ce25e..aa782977 100755 --- a/src/agentdecompile_recovery/source_parity_synthesize.py +++ b/src/agentdecompile_recovery/source_parity_synthesize.py @@ -24,7 +24,6 @@ from typing import Any, Iterable from .package_verify import build_shim, compile_with_msvc -from .state import now ROOT = Path.cwd() DEFAULT_VC_ROOT: Path | None = None