feat: enterprise policy config, enhanced compliance report, and PR fix suggestions#13
Merged
Merged
Conversation
bf49916 to
031bcad
Compare
added 2 commits
June 1, 2026 06:46
…x suggestions
Three major enhancements for enterprise adoption and developer experience:
1. Enterprise .ods.yaml Policy Config (P1)
- New internal/policy package with profile presets
- Three built-in profiles: oss, enterprise, regulated
- Configurable: branch types, PR sections, AI disclosure, severity levels
- Merge strategy: profile preset < .ods.yaml < CLI flags
- Policy-aware validation: ValidateBranchWithPolicy, etc.
- --profile and --policy flags on root command
2. Enhanced ODS Compliance Report (P2)
- Complete HTML template rewrite with score gauge, summary cards,
fix suggestions section with copy buttons, responsive design
- Markdown now includes policy info and fix suggestions
- JSON includes policy_profile and fix_suggestions arrays
- Enhanced SVG badge with policy prefix (ODS-OSS/ENT/REG) and N/100 score
3. PR Auto-fix Suggestions (P3)
- New FixSuggestion struct (title, description, copy-paste template)
- 14 distinct fix scenarios: branch, commit, and PR validation failures
- Fix suggestions appear in CLI output, Markdown report, and PR comments
- Templates are policy-aware (e.g., scope required only for enterprise/regulated)
031bcad to
e22df6e
Compare
…per spec Branch types: add feat and fix as valid aliases for feature and bugfix per the Conventional Branch 1.0.0 specification. Commit scope: set RequireScope to false for enterprise profile since scope is optional per the Conventional Commits specification. Also revert the CI dogfood test data (which was incorrectly changed to work around the overly-strict policy instead of fixing the root cause).
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
Three major enhancements for enterprise adoption and developer experience.
1. Enterprise
.ods.yamlPolicy Configuration (P1)Enterprises won't accept hardcoded rules. This adds a fully configurable policy system with three built-in profiles:
ossenterpriseregulatedNew
internal/policypackage:Policystruct withBranch,PR,Commit,AIDisclosure,SeverityMapconfig.ods.yaml→ CLI flagsLoadPolicy()/LoadPolicyFromFile()/GetSeverity()Policy-aware validators:
ValidateBranchWithPolicy(name, *Policy)— uses allowed types, ticket requirementValidateCommitMessageWithPolicy(msg, *Policy)— uses allowed types, scope requirement, subject lengthValidatePRDescriptionWithPolicy(body, *Policy)— uses required sections, AI disclosure rulesCLI flags:
--profile oss|enterprise|regulated— select compliance profile--policy <file>— explicit policy file pathExample:
2. Enhanced ODS Compliance Report (P2)
The HTML report now includes:
The SVG badge now shows policy prefix (ODS-OSS/ENT/REG) and N/100 score.
The Markdown report includes policy info and auto-generated fix suggestions.
The JSON includes
policy_profileandfix_suggestionsarrays.3. PR Auto-fix Suggestions (P3)
When validation fails, the tool now generates copy-paste fix templates:
ods validate)Example PR comment snippet:
feature/add-oauth-login
Files Changed
internal/policy/policy.gointernal/policy/policy_test.gointernal/validator/validator.gointernal/report/report.gointernal/cmd/root.go--profileand--policyflagsinternal/cmd/report.gointernal/cmd/validate.goTesting
Includes new
internal/policytest suite with 7 test functions covering profile presets, file loading, merging, severity defaults, and discovery.