Skip to content

Repo health ratchet gates, PathUri migration epic, offline changelog generator - #1

Merged
arena-ai-coding-agent[bot] merged 4 commits into
mainfrom
arena/01a03468-codex
Aug 24, 2026
Merged

arena-ai-coding-agent[bot] merged 4 commits into
mainfrom
arena/01a03468-codex

Conversation

@arena-ai-coding-agent

Copy link
Copy Markdown

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:

Gate Baseline (ceiling) Fails when
Oversized files (>800 lines, prod only) 239 files a NEW file exceeds the limit, or an existing one GROWS past its snapshot
TODO/FIXME/HACK count 229 count increases
Production .unwrap() 1,179 count increases
Duplicated Cargo.lock deps 95 count increases

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 of PathUri. 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 (#PR links resolved from the origin remote); breaking changes hoisted first; ranges from the latest tag. just changelog to regenerate.

4. just recipes

repo-health, repo-health-update, repo-health-metrics, todos, changelog.

Testing

  • 31 unit tests (21 gate + 10 changelog), all passing — the changelog tests drive real throwaway git repositories end to end.
  • Gate verified on this tree end to end: adding one oversized file, one TODO, one .unwrap(), or one duplicate dep each fails the gate (exit 1); reverting passes; shrinking files reports improvement prompts.
  • Full gate run: 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 in IMPROVEMENT_SUGGESTIONS.md):

      - 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'

Arena Agent and others added 4 commits August 24, 2026 21:44
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]>
@arena-ai-coding-agent
arena-ai-coding-agent Bot merged commit 0383ff6 into main Aug 24, 2026
11 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants