feat(rules): wire 4 new rule modules through the facade#326
Merged
Conversation
Delegates added on `Hypatia.Rules` for the rule families landed in PRs #320 (BaselineHealth BH004-007), #321 (WorkflowHardening WH001-012), #322 (SupplyChain SC001-011), and #323 (BranchProtection BP001-007). ## Surface - `scan_baseline_health/2` (existing — docstring refreshed for BH007 surface) - `scan_workflow_hardening/2` (new) - `scan_supply_chain/2` (new) - `scan_branch_protection/2` (new — API-backed; takes `owner, repo`) - `scan_all_estate_policies/2` (new — merges all four families into one result, optionally including branch-protection when `:owner_repo` opt is supplied) ## Why one combined facade Callers (pattern_analyzer, triangle_router, fleet_dispatcher) already treat `Hypatia.Rules` as a single namespace. Without these delegates, the new modules are reachable only via their fully-qualified names — which works but inverts the facade pattern the project committed to in PR #316. ## Test plan - Existing 18-test BaselineHealth suite still passes (untouched). - Module compile-checks pass for the four families plus the updated facade. ## Why ResearchExtensions (RE001-010) isn't included PR #325 (the ResearchExtensions module) is still OPEN at the time of this PR. Adding the alias here would break compilation on main between this PR and #325 landing. A follow-up commit will add the delegate once #325 merges; the work is tracked inline at the alias block as a `# wired in follow-up after PR #325 merges` comment.
🔍 Hypatia Security ScanFindings: 108 issues detected
View findings[
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/batch.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/scan.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/scan.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/fleet.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/output.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/build.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/fixer/src/main.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/integration/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "1 untracked file(s) -- review and add or .gitignore",
"type": "GS001",
"file": ".",
"action": "review",
"rule_module": "git_state",
"severity": "low"
},
{
"reason": "Repository has 3 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 108 issues detected
View findings[
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/batch.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/scan.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/scan.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/commands/fleet.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/src/output.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/cli/build.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/fixer/src/main.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/integration/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "low"
},
{
"reason": "1 untracked file(s) -- review and add or .gitignore",
"type": "GS001",
"file": ".",
"action": "review",
"rule_module": "git_state",
"severity": "low"
},
{
"reason": "Repository has 3 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
Summary
Adds delegates on `Hypatia.Rules` for the rule families landed in PRs #320, #321, #322, #323. The new modules were independently usable but invisible from the top-level facade; this PR closes that gap.
New facade surface
Why combined-scan helper
Callers (`pattern_analyzer`, `triangle_router`, `fleet_dispatcher`) already treat `Hypatia.Rules` as the entrypoint. Without these delegates the new modules are reachable only via fully-qualified names, which works but inverts the facade pattern adopted in #316.
RE001-RE010 (PR #325) not included
PR #325 (ResearchExtensions) is still OPEN at the time of this PR. Adding its alias here would break compilation on `main` for the window between this PR landing and #325 landing. A follow-up commit will wire `ResearchExtensions` once #325 merges — tracked inline at the alias block as a `# wired in follow-up` comment.
Test plan
🤖 Generated with Claude Code