Repository navigation
Repo health ratchet gates, PathUri migration epic, offline changelog generator - #1
Merged
Merged
Conversation
Implements suggestions #1, openai#3 and openai#10 from IMPROVEMENT_SUGGESTIONS.md: File-size ratchet gate (AGENTS.md module-size guidance): - scripts/check_repo_health.py gates on an 800-line limit for production Rust files (tests, vendor, generated code excluded). Existing debt is snapshotted in scripts/repo-health-baseline.json; any NEW oversized file or GROWTH past the baseline fails CI, shrinkage always passes. - --metrics dashboard: production unwrap count, TODO count, duplicated Cargo.lock dependency versions (95 today). TODO ratchet gate: - The baseline also records the production TODO/FIXME/HACK count (229); any new TODO fails CI, deletions ratchet the count down. - --todos report groups TODO mentions by owner tag (anp owns 57). - 15 unit tests cover all gate scenarios. PathUri migration epic (suggestion openai#3): - PATHURI_MIGRATION.md maps the documented TODO(anp) debt: 42 production sites across 22 files and 10 crates where paths cross process boundaries as native paths instead of PathUri. Five dependency-ordered phases with acceptance criteria; completing it removes ~19% of all production TODO debt in one epic. CI: repo-checks.yml runs the gate and its unit tests; justfile gains repo-health, repo-health-update, repo-health-metrics and todos recipes. Co-authored-by: arena-agent <[email protected]>
…nerator Extends the repo health gates to cover all dashboard metrics and makes the changelog offline-browsable (suggestions openai#6 and openai#9): - check_repo_health.py now ratchets production .unwrap() count (1179) and duplicated Cargo.lock dependency names (95) in addition to the TODO count and oversized-file snapshot; any regression fails CI and improvements prompt a baseline ratchet-down. - 6 new unit tests cover both gates (21 total for the gate). - scripts/generate_changelog.py: dependency-free CHANGELOG.md generator that understands both Conventional Commits and GitHub squash-merge subjects (#PR links resolved from the origin remote), hoists breaking changes, and ranges from the latest tag by default. - scripts/test_generate_changelog.py: 10 unit tests driving real throwaway git repositories end to end. - justfile: new 'changelog' recipe; CI runs the generator's tests. - CHANGELOG.md regenerated as a real searchable document. Co-authored-by: arena-agent <[email protected]>
The push token used here cannot modify GitHub workflow files. The two
CI steps below must be applied manually (or via the GitHub UI) after
merge — paste them under 'Test Codex package builder' in repo-checks.yml:
- name: Repo health ratchet (files, TODOs, unwraps, dup deps)
run: python3 scripts/check_repo_health.py
- name: Test repo health gate script
run: python3 -m unittest discover -s scripts -p 'test_check_repo_health.py'
- name: Test changelog generator script
run: python3 -m unittest discover -s scripts -p 'test_generate_changelog.py'
The gate itself is fully usable via 'just repo-health' without CI.
Co-authored-by: arena-agent <[email protected]>
Co-authored-by: arena-agent <[email protected]>
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.
What changed
Implements the script-testable items from the repo health review (
IMPROVEMENT_SUGGESTIONS.md):1. Repo health ratchet gates (
scripts/check_repo_health.py)Enforces the AGENTS.md module-size guidance and debt ceilings with a ratchet — existing debt is snapshotted, so the only allowed direction is improvement:
.unwrap()Excludes tests, vendored, and generated code (OpenAPI models). Improvements are reported with a prompt to ratchet the baseline down.
2. PathUri migration epic (
PATHURI_MIGRATION.md)Executable plan for the documented
TODO(anp)debt: an automated inventory found 42 production sites across 22 files / 10 crates where paths cross process boundaries as native paths instead ofPathUri. Five dependency-ordered phases with acceptance criteria; completing the epic removes ~19% of all production TODO debt.3. Offline changelog generator (
scripts/generate_changelog.py)Replaces the one-line CHANGELOG.md pointer with a real, searchable document generated from git history. Understands both Conventional Commits and GitHub squash-merge subjects (
#PRlinks resolved from the origin remote); breaking changes hoisted first; ranges from the latest tag.just changelogto regenerate.4.
justrecipesrepo-health,repo-health-update,repo-health-metrics,todos,changelog.Testing
.unwrap(), or one duplicate dep each fails the gate (exit 1); reverting passes; shrinking files reports improvement prompts.239 files / 229 TODOs / 1179 unwraps / 95 dup deps — all within baseline.Manual follow-up (bot token cannot edit workflow files)
Add these steps to
.github/workflows/repo-checks.yml(snippet also inIMPROVEMENT_SUGGESTIONS.md):