Repository navigation
rules analyze: detect unreachable assertions inside quantifiers and when: leaves - #96
Merged
Merged
Conversation
…hen: leaves RuleSetAnalyzer only checked top-level assertions against the target selector's Produces, so a mismatched kind inside must_all_match/must_any_match/must_none_match (checked against the nested selector) or inside a when: tree silently failed every candidate. The parsed model keeps only assertion Kind, so these are now checked against the raw source document, using CapabilityDescriptor Produces/AppliesTo. UnreachableAssertionIssue gains a Location path (e.g. assertions[0].assertions[1], when.and[1]) that the CLI report prints. Top-level behaviour is unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xouw37Lmze9pVQhpCJZKix
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #44
Summary
RuleSetAnalyzernow checks assertions nested inmust_all_match/must_any_match/must_none_matchagainst that quantifier'sselector:Produces, recursing for quantifiers nested in quantifiers.when:leaves (throughand/or/not) are checked against the rule's target selector.when:checks walk the raw source document, since onlyIAssertion.Kindsurvives parsing; kinds missing from the catalog are skipped silently.UnreachableAssertionIssuegains aLocationpath (e.g.assertions[0].assertions[1],when.and[1]), printed byrules analyze. Top-level findings are unchanged apart from the added location.NestedMismatch_IsNotFlaggedByAnalyzer...is flipped toNestedMismatch_IsFlaggedByAnalyzer_AndNeverCrashesEvaluation. The generator no longer falls back to a non-guaranteed mismatch, so the assertion is sound.HIGH_LEVEL_AI_ASSISTING.md§14 known-limitation text andIMPLEMENTATION_STATUS.mdupdated.Verification
dotnet build: 0 warnings, 0 errorsdotnet test: all pass (Analyzers.Repository 1, Configuration 231, Analyzers.Roslyn 49, Evaluation 460, RuleFuzzing 7, Cli 117, Core 54, IntegrationTests 24)dotnet format --verify-no-changes: cleanrules test --rules-source examples/rules: 251/251rules analyze --rules-source examples/rules: 0 unreachable assertions (no new findings)🤖 Generated with Claude Code
https://claude.ai/code/session_01Xouw37Lmze9pVQhpCJZKix