4#7
Merged
Merged
Conversation
This was referenced May 13, 2026
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 #4.
Phase 1A: rules pack scaffolding with the first five tier-1 rules drawn verbatim from
code-review-methodology/en/quick-reference.md. The schema gains aRuleDefinitionenum (externally tagged) replacing the now-removedTierenum, so a rule's analysis tier is encoded in its definition variant.Schema (
#4 feat reshape rule schema with external tagged ruledefinition)Rule { id, severity, title, rationale_uri, definition }— the standalonetierfield is gone.RuleDefinitionis an externally tagged enum:Pattern { regex, exclude_globs },Ast { check },Semantic { check }. External tagging maps cleanly to TOML's[definition.pattern]table syntax.rename_all_fields = "kebab-case"on the enum so inner payload fields serialize as kebab too (exclude-globs).crates/rustmanifest-schema/schemas/.Rules pack (
#4 feat add rules pack with build script and first five tier 1 rules)crates/rustmanifest-rules-core/rules/directory, one rule per subdir:RM-SEC-001— Hardcoded credentials.RM-SEC-002— SQL injection viaformat!.RM-SEC-003— Command injection viaformat!.RM-RUST-001— Panic in production (.unwrap()/.expect(/panic!).RM-PERF-001—Vec::new()withoutwith_capacity.rule.toml+pass.rs+fail.rs. The fixtures are real Rust snippets and double as the contract for what the regex must and must not match.build.rswalksrules/, parses eachrule.tomlvia the canonicalRuletype fromrustmanifest-schema, validates that the directory name equals the rule id, and emits a singlerules.jsonintoOUT_DIR.lib.rsexposespub static RULES: LazyLock<Vec<Rule>>viainclude_str!of the build-emitted JSON. The deserialization step inside theLazyLockclosure carries an inline#[allow(clippy::expect_used)]with areasonfield — the embedded JSON is build-time-validated, so a runtime parse failure indicates a corrupted binary, which is unrecoverable.tests/rules.rs:^RM-(SEC|PERF|RUST|QUAL|STRUCT)-\d{3}$.fail.rstriggers its regex.pass.rsdoes NOT trigger its regex.New dependencies
rustmanifest-rules-core:regex 1,serde_json 1.rustmanifest-rules-core:toml 1(latest, MIT).regex = "1",toml = "1".cargo tree --duplicatesis clean —multiple-versions = "deny"indeny.tomlstays satisfied.Local verification
Out of scope (deferred to follow-up Phase 1 PRs)
STRUCTURE.md— Phase 1C.checksubcommand wiring, JSON / SARIF / TTY renderers — Phase 1D.