Skip to content

Commit eb8580d

Browse files
Tighten audit prompt budgets and prefer sandbox-local OpenCode binary so Codex Spark runs finish more reliably and write findings output consistently.
1 parent f608fb8 commit eb8580d

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

src/analyze-repos.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,41 +618,48 @@ function buildAnalysisPrompt(params: { inputUrl: string; reportPath: string }):
618618
"",
619619
"Workflow requirements:",
620620
"1) Read README and infer claimed scope/completeness.",
621-
"2) Inspect code paths and architecture.",
622-
"3) Run the project where sensible (install deps, tests, build, or smoke run).",
621+
"2) Inspect highest-signal code paths and architecture.",
622+
"3) Run a small runtime check where sensible (install + one or two commands max).",
623623
"4) Capture meaningful command evidence and errors; do not fabricate.",
624624
"5) Evaluate implementation quality honestly.",
625625
"6) Compare alternatives (products/repos) that do similar things better, with links.",
626626
"",
627+
"Execution budget:",
628+
"- Keep tool usage focused (target <= 8 tool calls total).",
629+
"- Prioritize high-signal files first: README, package manifest, main implementation files, and tests.",
630+
"- Runtime validation should be concise: 1-2 high-value commands max.",
631+
"",
627632
`Write a markdown report to this exact path: ${params.reportPath}`,
628633
"",
629634
"Required markdown sections (in this order):",
630635
"1. Input URL",
631636
"2. Claimed Purpose (from README)",
632637
"3. Reality Check Summary",
633-
" - Keep this very concise and easy to scan (4-7 bullets max).",
638+
" - Keep this concise and easy to scan (4-7 bullets max).",
634639
" - Sentence fragments are allowed and encouraged when clearer.",
635-
"4. More Accurate Title + Description",
636-
"5. How It Works (logic walkthrough)",
640+
"4. How It Works (logic walkthrough)",
637641
" - Explain the end-to-end flow in plain terms.",
638642
" - Include at least one ASCII diagram that maps key components and data flow.",
639-
"6. Functionality Breakdown (logically grouped)",
643+
"5. Functionality Breakdown (logically grouped)",
640644
" - For each group: what exists, what's solid, what's partial/sloppy, with file-path evidence.",
641-
"7. Runtime Validation",
645+
"6. Runtime Validation",
642646
" - Commands run, key logs/output, blockers.",
643-
"8. Quality Assessment",
647+
"7. Quality Assessment",
644648
" - correctness, maintainability, test quality, production-readiness risks.",
645-
"9. Usefulness & Value Judgment",
646-
" - who should use it, who should not, where it is valuable.",
647-
"10. Better Alternatives",
649+
"8. Better Alternatives",
648650
" - at least 3 alternatives with links and why they are better for specific scenarios.",
649-
"11. Final Verdict",
650-
" - completeness score (0-10) and practical value score (0-10), with rationale.",
651+
"9. Final Verdict",
652+
" - include completeness score (0-10) and practical value score (0-10), with rationale.",
653+
"10. Usefulness & Value Judgment",
654+
" - who should use it, who should not, where it is valuable.",
651655
"",
652656
"Constraints:",
653657
"- Be direct and specific.",
654658
"- Prefer concise bullets over long prose paragraphs.",
655659
"- Sentence fragments are acceptable.",
660+
"- Do not output planning notes, handoff notes, or 'continue' prompts.",
661+
"- Final step must write the complete report to the exact target path before exiting.",
662+
"- Stop immediately after writing the report file.",
656663
"- If something cannot be validated, state it explicitly.",
657664
"- Save only the final report file.",
658665
].join("\n");
@@ -773,9 +780,9 @@ async function analyzeOneRepo(params: {
773780
);
774781

775782
const resolveOpencodeBin =
776-
"if command -v opencode >/dev/null 2>&1; then command -v opencode; " +
777-
'elif [ -x "$HOME/.bun/bin/opencode" ]; then echo "$HOME/.bun/bin/opencode"; ' +
783+
'if [ -x "$HOME/.bun/bin/opencode" ]; then echo "$HOME/.bun/bin/opencode"; ' +
778784
'elif [ -x "$HOME/.local/bin/opencode" ]; then echo "$HOME/.local/bin/opencode"; ' +
785+
"elif command -v opencode >/dev/null 2>&1; then command -v opencode; " +
779786
'else echo "opencode binary not found in PATH, ~/.bun/bin, or ~/.local/bin" >&2; exit 127; fi';
780787

781788
const prompt = buildAnalysisPrompt({

0 commit comments

Comments
 (0)