Skip to content

Honor judge BLOCK when score is low - #90

Merged
chiruu12 merged 1 commit into
devfrom
fix/judge-action-block
Jul 20, 2026
Merged

Honor judge BLOCK when score is low#90
chiruu12 merged 1 commit into
devfrom
fix/judge-action-block

Conversation

@chiruu12

Copy link
Copy Markdown
Collaborator

Summary

  • Clamp judge finding scores so declared action drives enforcement: block raises to at least block_threshold, review lands in the review band, allow caps below review_threshold
  • Wire ScanPolicy thresholds through InputPipelineJudgeResult.to_finding
  • Document the contract in LIMITS_AND_JUDGE.md

Fixes#86

Test plan

  • make check
  • make test-cov (sdk; ≥80%)
  • Low-score judge action=blockAction.BLOCK via CallableJudge
  • High-score judge action=allow stays ALLOW when scanners are clean
  • Unit tests for enforced_score / string "block" parsing

@greptile-apps

Copy link
Copy Markdown

Greptile Summary

This PR makes judge actions drive score-based enforcement. The main changes are:

  • Added score clamping for judge block, review, and allow results.
  • Passed ScanPolicy thresholds into judge finding conversion.
  • Added tests for low-score blocks and high-score allows.
  • Documented the judge action and score contract.

Confidence Score: 4/5

The judge action path can still return the wrong enforcement result.

  • Allow findings can be raised again by the sensitive-context boost.
  • Review findings can become redact or block when custom thresholds collapse the review band.
  • The changed threshold wiring otherwise matches the intended flow.

sdk/src/unplug/core/judge.py

Important Files Changed

FilenameOverview
sdk/src/unplug/core/judge.pyAdds judge score clamping, but some policy and boost interactions can still override the declared action.
sdk/src/unplug/pipelines/input.pyPasses ScanPolicy thresholds into judge finding conversion.
sdk/tests/integration/test_guard_limits.pyAdds integration coverage for low-score block and high-score allow behavior.
sdk/tests/unit/core/test_judge.pyAdds unit coverage for enforced score behavior and string action parsing.
sdk/docs/LIMITS_AND_JUDGE.mdDocuments how judge actions affect score handling.

Fix All in Claude Code

Reviews (1): Last reviewed commit: "Honor judge BLOCK when score is low" | Re-trigger Greptile

Comment threadsdk/src/unplug/core/judge.py
Comment threadsdk/src/unplug/core/judge.py
@github-actions

Copy link
Copy Markdown

coverage

SDK Coverage •
FileStmtsMissCoverMissing
src/unplug/core
judge.py83495%65, 73–74, 164
src/unplug/pipelines
input.py88495%147, 164–166
TOTAL724889687%

TestsSkippedFailuresErrorsTime
120825 💤0 ❌0 🔥40.387s ⏱️

@chiruu12
chiruu12 merged commit eaeb3d2 into devJul 20, 2026
6 checks passed
@chiruu12
chiruu12 deleted the fix/judge-action-block branch July 20, 2026 13:54
@chiruu12chiruu12 mentioned this pull request Jul 20, 2026
2 tasks
Sign up for freeto 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.

[bug] Judge action=block ignored when score is low

1 participant

@chiruu12