Skip to content

fix: reject blank semantic tokens and padded identities - #32

Merged
bewaterhere-coder merged 3 commits into
mainfrom
fix/semantic-rule-token-validation
Nov 1, 2026
Merged

bewaterhere-coder merged 3 commits into
mainfrom
fix/semantic-rule-token-validation

Conversation

@bewaterhere-coder

Copy link
Copy Markdown
Owner

Summary

  • Reject whitespace-only entries in semantic_rules[].tokens while preserving meaningful spaces inside code tokens.
  • Reject leading/trailing whitespace in semantic rule id, plugin_id, and topic fields.
  • Add regression tests for blank tokens, padded identity fields, and valid code tokens containing spaces.

Why

A whitespace-only token can match ordinary source lines and produce misleading pattern_observed_control_flow_unverified evidence. Padded identity fields can also silently fail exact matching against plugin IDs and clause/rule references.

Boundaries

  • No change to token matching semantics for non-blank literals.
  • No API or schema version change.
  • Diagnostics remain non-blocking; this validates Profile declarations only.

Validation

Python 3.10–3.13, MCP stdio E2E and Sample Project Advisory.

@bewaterhere-coder
bewaterhere-coder merged commit 370a6f3 into main Nov 1, 2026
6 checks passed
@bewaterhere-coder
bewaterhere-coder deleted the fix/semantic-rule-token-validation branch November 1, 2026 00:56
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