feat: governance and git vitality scoring#66
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8563b351d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """INSERT INTO repo_snapshots | ||
| (repo_name, timestamp, overall_score, lint_score, security_score, complexity_score, | ||
| governance_score, vitality_score, | ||
| total_findings, total_loc, findings_json) | ||
| VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)""", | ||
| VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", |
There was a problem hiding this comment.
Add schema migration before writing new score columns
This insert now always references governance_score/vitality_score, but _init_db only uses CREATE TABLE IF NOT EXISTS; it never ALTERs existing tables. On any pre-existing arbiter_data.db created before this commit, record_snapshot (and similarly record_commit) will raise sqlite3.OperationalError: no column named governance_score, which breaks normal analyze/fleet runs instead of being backward-compatible.
Useful? React with 👍 / 👎.
| for i in range(total_checked): | ||
| if "signed-off-by:" in commits[i].message.lower(): | ||
| signed_count += 1 |
There was a problem hiding this comment.
Read full commit messages for DCO ratio calculation
The signed-commit check inspects commits[i].message, but in this repo walk_commits() populates CommitInfo.message from git %s (subject only), so Signed-off-by: trailers in commit bodies are never seen. In repositories that actually enforce DCO via trailers, this will systematically undercount signed commits (often to 0%), lowering vitality and potentially certification outcomes.
Useful? React with 👍 / 👎.
8563b35 to
8461cc7
Compare
Summary
Implements two new scoring modules: governance_quality.py and git_vitality.py.
Includes TDD tests and fleet integration.
Key Changes
• New module: governance_quality.py (analyzes content of governance files)
• New module: git_vitality.py (analyzes commit history, bus factor, etc.)
• Integration: integrated into full certification workflow and fleet audit
• Persistence: scores now saved to fleet.db and audit log
Verification
• 10 new tests pass
• Fleet audit verified with real data
• Stdlib-only compliance confirmed
• Manual audit: PASS