Skip to content

feat: validate rule file syntax conventions#159

Merged
rhuanbarreto merged 2 commits into
mainfrom
feat/rule-syntax-validation
Mar 23, 2026
Merged

feat: validate rule file syntax conventions#159
rhuanbarreto merged 2 commits into
mainfrom
feat/rule-syntax-validation

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Adds a syntax convention check to the rule loader that blocks .rules.ts files missing the /// <reference path="../rules.d.ts" /> directive or the satisfies RuleSet type assertion
  • Reports these as blocked violations during archgate check with actionable error messages pointing to the exact location
  • Updates blockedToRuleResult to distinguish syntax-check vs security-scan rule IDs
  • Updates all test files to include the required syntax conventions

Test plan

  • bun run validate passes (lint, typecheck, format, 586 tests, 22 ADR checks, build)
  • Verify a rule file missing the triple-slash reference is reported as blocked
  • Verify a rule file missing satisfies RuleSet is reported as blocked
  • Verify a rule file missing both conventions reports 2 violations
  • Verify existing valid rule files continue to load and execute normally

… satisfies RuleSet)

Rule files that omit the `/// <reference path="../rules.d.ts" />` directive
or the `satisfies RuleSet` type assertion are now reported as blocked
violations during `archgate check`, preventing execution of malformed rules.
@rhuanbarreto rhuanbarreto merged commit f600f88 into main Mar 23, 2026
7 checks passed
@rhuanbarreto rhuanbarreto deleted the feat/rule-syntax-validation branch March 23, 2026 19:49
@github-actions github-actions Bot mentioned this pull request Mar 23, 2026
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