Skip to content

chore: enhance prejudge output with specific failure reasons#14

Merged
LeiGuo622 merged 1 commit into
mainfrom
chore/detailed-output
Apr 15, 2026
Merged

chore: enhance prejudge output with specific failure reasons#14
LeiGuo622 merged 1 commit into
mainfrom
chore/detailed-output

Conversation

@LeiGuo622
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 14:34
@LeiGuo622 LeiGuo622 merged commit 83c3b2d into main Apr 15, 2026
2 checks passed
@LeiGuo622 LeiGuo622 deleted the chore/detailed-output branch April 15, 2026 14:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances the prejudge CLI output to include more specific failure reasons when a commit is rejected during analysis, improving diagnosability of “false” outcomes.

Changes:

  • Print a specific reason when fix commits are missing in the target project.
  • Print a specific reason when required CONFIGs are not enabled in any scanned architecture config.
  • Print a specific reason when the LLM judge determines vulnerable code is not present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/prejudge/prejudge.py
Comment on lines +220 to 221
print("false, fix commits missing")
return
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analyze_and_report docstring states the output is just true/false, but this branch now prints false, ... on stdout. If callers parse stdout as a strict boolean (consistent with judge_llm.py / judge_agent.py printing exactly true/false), this becomes a breaking CLI change. Consider keeping stdout strictly true/false and emitting the reason to stderr (or behind a flag), and update the docstring accordingly.

Copilot uses AI. Check for mistakes.
Comment thread src/prejudge/prejudge.py
if not is_enabled:
# CONFIG not enabled in any architecture
print("false")
print("false, arch not supported")
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This failure reason is misleading: the condition here is that none of the required CONFIGs are enabled in any of the scanned arch config files, not that the commit/patch targets an unsupported architecture. Consider changing the message to reflect “CONFIG not enabled” (or similar) so users don’t misdiagnose the cause.

Suggested change
print("false, arch not supported")
print("false, CONFIG not enabled")

Copilot uses AI. Check for mistakes.
Comment thread src/prejudge/prejudge.py
# Output final result based on agent's decision
print("true" if agent_result else "false")

print("true" if agent_result else "false, vulnerable code not found")
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the final stdout from a strict boolean to a boolean+reason string. To avoid breaking integrations that expect exactly true/false, consider preserving machine-readable stdout (e.g., true/false only) and placing the human-readable reason on stderr or behind an --explain/--verbose option; also update the docstring that still claims the output is only true/false.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants