Skip to content

Exclude non-Azure controls from confidence/sovereignty stats; split Review & Edit UI - #57

Merged
warrendt merged 1 commit into
mainfrom
warrendt-fuzzy-potato
Aug 10, 2026
Merged

Exclude non-Azure controls from confidence/sovereignty stats; split Review & Edit UI#57
warrendt merged 1 commit into
mainfrom
warrendt-fuzzy-potato

Conversation

@warrendt

Copy link
Copy Markdown
Owner

Fixes three accuracy issues surfaced during live testing

1. Misleading Average Confidence. C_Process/D_MicrosoftAttestation controls carry a fixed 0.0 confidence_score placeholder — Azure Policy mapping is never attempted for them, so 0.0 isn't a low score, it's "not applicable." Averaging it in with real A/B confidence judgements dragged a batch that matched its enforceable controls well (22 of 27 high-confidence) down to a misleading 30% headline number. Added coverage.confidence_eligible() (backend) / utils/coverage.py (frontend mirror) and scoped every average-confidence computation to A/B (+ legacy unclassified) controls only — ai_mapping_service.py, validator.py, and all three frontend pages.

2. Sovereignty Mapping shown on process/attestation controls with no real sovereignty tie. A due-diligence/risk-assessment control (clearly C_Process) was still rendering a full "Level: L1 — Global, Target Archetype: sovereign_root" card even though the AI's own reasoning said "no sovereignty requirement applies." The prompt asks for a sovereignty verdict on every control, defaulting to L1/sovereign_root with an empty objectives list when none applies — next to a control that constructs no initiative entry, that default reads as a contradictory second verdict. Added coverage.clear_moot_sovereignty(), which nulls the sovereignty field for C/D controls with no real sovereignty_objectives, while preserving the one legitimate exception (a procedural objective like SO-2 Customer Lockbox — no policy, but genuine sovereignty relevance).

3. Split Review & Edit into two tabs. "Policy Mappings" (A_AzurePolicy / B_AzureConfig — confidence, sovereignty, Azure Policy candidates, unchanged UX) and "Manual Register" (C_Process / D_MicrosoftAttestation — read-only, shows coverage_reason, responsibility, and for D controls the grounded attestation citation or an explicit attestation-gap warning). No Azure Policy initiative entry is constructed for Manual Register controls, so they no longer carry a confidence score or sovereignty verdict that never applied to them — matching how the Export page's manual register already worked.

Verification

Full backend suite: 639 passed. Full frontend suite: 846 passed, 14 pre-existing failures identical (same test names) to the pre-change baseline — confirmed via git stash diff, no regressions introduced.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Copilot-Session: 322e5e54-ab2e-43b0-956c-5ec01cd955e7

…view UI

Three related accuracy issues in the mapping review flow:

1. Average Confidence (and High/Low Confidence counts) averaged in every
   C_Process/D_MicrosoftAttestation control's confidence_score, which is a
   fixed 0.0 placeholder - Azure Policy mapping is never attempted for these
   controls, so 0.0 isn't a low score, it's "not applicable". Mixing them
   with real A/B confidence judgements dragged a batch that matched its
   enforceable controls well down to a misleading headline number (e.g. 30%
   average confidence on a batch where 22 of 27 policy-eligible controls
   were actually high-confidence). Added coverage.confidence_eligible() /
   frontend utils/coverage.py and scoped every average-confidence
   computation (ai_mapping_service.py, validator.py, and all three frontend
   pages) to A/B (+ legacy unclassified) controls only.

2. C/D controls were showing a full Sovereignty Mapping card (Level: L1,
   Target Archetype: sovereign_root) even when the AI's own reasoning said
   "no sovereignty requirement applies" - the prompt asks for a sovereignty
   verdict on every control, defaulting to L1/sovereign_root with an empty
   objectives list when none applies. Next to a control that constructs no
   initiative entry, that default read as a second, contradictory verdict.
   Added coverage.clear_moot_sovereignty(), which nulls the sovereignty
   field for C/D controls with no real sovereignty_objectives, while
   preserving the one legitimate exception (a procedural objective like
   SO-2 Customer Lockbox, which has no policy but genuine sovereignty
   relevance).

3. Split Review & Edit into two tabs: "Policy Mappings" (A_AzurePolicy /
   B_AzureConfig - confidence, sovereignty, Azure Policy candidates, exactly
   as before) and "Manual Register" (C_Process / D_MicrosoftAttestation -
   read-only, shows coverage_reason, responsibility, and for D controls the
   grounded attestation citation or an explicit attestation-gap warning).
   No Azure Policy initiative entry is constructed for Manual Register
   controls, so they no longer carry a confidence score or sovereignty
   verdict that never applied to them.

Verified: full backend suite (639 passed) and frontend suite (846 passed,
14 pre-existing failures identical to baseline) both regression-clean.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 322e5e54-ab2e-43b0-956c-5ec01cd955e7
@warrendt
warrendt force-pushed the warrendt-fuzzy-potato branch from 981a192 to 3298268 Compare August 10, 2026 16:47
@warrendt
warrendt merged commit 2075d92 into main Aug 10, 2026
1 check passed
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.

1 participant