From 34b60e37c938ce56d0e5deca30f7e50f91c4324f Mon Sep 17 00:00:00 2001 From: David Bond Date: Tue, 10 Nov 2026 11:27:16 +0000 Subject: [PATCH] fix: a negated exam question is not scored as created Fixes #11. 'No certification exam question is proposed ...' scores as not needed with a reason; a bare negation scores as no exam question created. --- .../Rubrics/NotNeededTierTests.cs | 24 +++++++++++++++++++ .../Rubrics/panoramicdata-ticket-quality.json | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/PanoramicData.IssueAssessment.Tests/Rubrics/NotNeededTierTests.cs b/PanoramicData.IssueAssessment.Tests/Rubrics/NotNeededTierTests.cs index e95252d..c585223 100644 --- a/PanoramicData.IssueAssessment.Tests/Rubrics/NotNeededTierTests.cs +++ b/PanoramicData.IssueAssessment.Tests/Rubrics/NotNeededTierTests.cs @@ -39,6 +39,30 @@ public async Task NoCertificationQuestionBare_Scores0() public async Task NoCertificationQuestionNA_Scores0() => (await Item("Certifications", "No certification question: N/A", "Improvement", "MS")).Finding.Should().NotContain("Not needed"); + [Fact] + public async Task NegatedExamQuestionWithReason_IsNotNeeded_NotCreated() + { + // Issue #11 (MS-28010). + AssessmentReportItem item = await Item("Certifications", "h2. Documentation\r\nNo certification exam question is proposed for a single display column.", "Improvement", "MS"); + item.Finding.Should().Be("✓ Certifications: Not needed (reason given)"); + item.RawScore.Should().Be(100); + } + + [Theory] + [InlineData("No exam question.")] + [InlineData("No certification question.")] + public async Task NegatedExamQuestionWithoutReason_IsNotCreated(string description) + { + AssessmentReportItem item = await Item("Certifications", description, "Improvement", "MS"); + item.Finding.Should().Be("○ Certifications: No exam question created"); + item.RawScore.Should().Be(0); + } + + [Fact] + public async Task ExamQuestionMentionedWithoutNegation_IsStillCreated() + => (await Item("Certifications", "Added certification exam question 42 covering the new column.", "Improvement", "MS")) + .Finding.Should().Be("✓ Certifications: Exam question(s) created"); + [Fact] public async Task AppliesToOpsToo() { diff --git a/PanoramicData.IssueAssessment/Rubrics/panoramicdata-ticket-quality.json b/PanoramicData.IssueAssessment/Rubrics/panoramicdata-ticket-quality.json index 7b11847..6b97eee 100644 --- a/PanoramicData.IssueAssessment/Rubrics/panoramicdata-ticket-quality.json +++ b/PanoramicData.IssueAssessment/Rubrics/panoramicdata-ticket-quality.json @@ -299,7 +299,9 @@ "tiers": [ { "when": { "type": "ref", "name": "isBug" }, "score": 100, "finding": "○ Certifications: Not applicable for bugs" }, { "when": { "type": "textMatches", "source": { "paths": [ "$.description" ] }, "patterns": [ "(?im)^\\W*no certification question:\\s*(?!n/?a\\b)\\S.{14,}" ] }, "score": 100, "finding": "✓ Certifications: Not needed (reason given)" }, - { "when": { "type": "textMatches", "source": { "paths": [ "$.title", "$.description" ] }, "patterns": [ "certifica?tion|exam|certification\\s+question", "cert\\s+question", "assessment\\s+question", "test\\s+question" ] }, "score": 100, "finding": "✓ Certifications: Exam question(s) created" }, + { "when": { "type": "textMatches", "source": { "paths": [ "$.description" ] }, "patterns": [ "(?i)\\bno\\s+(?:certification\\s+)?(?:exam\\s+|assessment\\s+|test\\s+)?question\\b[^\\r\\n]{10,}" ] }, "score": 100, "finding": "✓ Certifications: Not needed (reason given)" }, + { "when": { "type": "textMatches", "source": { "paths": [ "$.description" ] }, "patterns": [ "(?i)\\bno\\s+(?:certification\\s+)?(?:exam\\s+|assessment\\s+|test\\s+)?question\\b" ] }, "score": 0, "finding": "○ Certifications: No exam question created", "recommendation": "Consider creating a certification exam question for this new feature" }, + { "when": { "type": "textMatches", "source": { "paths": [ "$.title", "$.description" ] }, "patterns": [ "certifica?tion|exam|certification\\s+question", "cert\\s+question", "assessment\\s+question", "test\\s+question" ] }, "score": 100, "finding": "✓ Certifications: Exam question(s) created" }, { "score": 0, "finding": "○ Certifications: No exam question created", "recommendation": "Consider creating a certification exam question for this new feature" } ] }