(dir string, review, block float64)
| 77 | } |
| 78 | |
| 79 | func validThresholds(dir string, review, block float64) error { |
| 80 | if review < 0 || review > 1 || block < 0 || block > 1 { |
| 81 | return fmt.Errorf("%s scan thresholds must be between 0 and 1", dir) |
| 82 | } |
| 83 | // Strict <: equal thresholds collapse the review band so a score at the cutoff |
| 84 | // jumps straight to block — e.g. (0,0) blocks every clean message. Require a real |
| 85 | // allow < review < block ladder. |
| 86 | if review >= block { |
| 87 | return fmt.Errorf("%s_scan_review_threshold must be < %s_scan_block_threshold", dir, dir) |
| 88 | } |
| 89 | return nil |
| 90 | } |
| 91 | |
| 92 | // UpdateAgentScanConfig writes the full screening config for an agent owned by |
| 93 | // userID, validating the effective posture first. Returns an error if the agent |
no outgoing calls
no test coverage detected