From 1de274c35c5b7fb775504866dc1dc3156792a318 Mon Sep 17 00:00:00 2001 From: Jon Chery Date: Tue, 21 Jul 2026 13:26:46 +0000 Subject: [PATCH] fix(P03): confidence_signal emits literal 0.90/0.40 (T-3.6) ---ci--- phase: 3 milestone: v1.0 status: execute persona: backend-engineer task: T-3.6 requirements: covered: [REQ-08] ---/ci--- Wave 2, task T-3.6. json.dumps collapsed 0.90 -> 0.9; emit literal two-decimal score per contract while remaining valid JSON. --- scripts/confidence_signal.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/confidence_signal.py b/scripts/confidence_signal.py index f4b1991..d47168b 100755 --- a/scripts/confidence_signal.py +++ b/scripts/confidence_signal.py @@ -37,15 +37,17 @@ def main() -> int: ) if proc.returncode == 0: - score = 0.90 + score = "0.90" # POLICY_PASS is the expected stdout; strip any trailing whitespace. reason = proc.stdout.strip() or "POLICY_PASS" else: - score = 0.40 + score = "0.40" # The violation code (e.g. "POLICY_VIOLATION:PUBLIC_INGRESS") is on stdout. reason = proc.stdout.strip() or "POLICY_VIOLATION:UNKNOWN" - print(json.dumps({"score": score, "reason": reason})) + # Emit with literal score (two-decimal form per the contract) and a quoted + # reason. Constructed manually so json.dumps does not collapse 0.90 -> 0.9. + print('{"score": ' + score + ', "reason": ' + json.dumps(reason) + '}') return 0