Bounded bidirectional advisor de-escalation (D-0049) #124
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/advisor-deescalation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Final feature of the advisor control-refinements program (ADR D-0049). Turns the escalate-only clamp into a bounded bidirectional clamp that may lower severity and confidence below the deterministic base, but only under strict eligibility. Every ineligible path is byte-for-byte the previous escalate-only behaviour.
A consult may de-escalate only when ALL hold:
DeEscalationEnabled(effective, per-category resolved) is true - disabled by defaultInjectionDetected == false) - any detection keeps escalate-only, so a prompt-injection attempt can never cause a downward moveDeEscalationProtectedSeverity(default 7, mirroring the policyActionMinSeveritydefault) - a base classification already at the action severity can never be talked downDeEscalationMinModelConfidence(default 0.7) - uncertain output cannot lower a deterministic decisionWhen eligible, the lower bound is
base - MaxDownwardSeverityDelta(default 1, floored at 0) andbase - MaxDownwardConfidenceDelta(default 0.10, floored at 0.0); the upward bound is unchanged. It applies to the final combined output, so under the ensemble (D-0047) both models must agree to lower, and it is re-applied on response-cache hits (D-0046). The downward deltas and the toggle are per-category overridable vialocal_model_advisor_category_bands(D-0044); protected-severity and min-confidence are global.A sixth
AdvisorConsultOutcomevalueDeEscalatedrecords a downward move (escalation rate stays Escalated/total);/advisorand/api/v1/advisorreport the de-escalation count and rate, and a de-escalated consult carries an[advisor] advisor lowered assessmentreason.How was this tested?
dotnet build- 0 errors, 0 warningsdotnet test- 934 pass, 0 fail, 0 skip (+18 from 916)Checklist