Skip to content

[codex] Add agent-friendly refactor audit routing#44

Merged
NeapolitanIcecream merged 4 commits intomainfrom
codex/agent-friendly-refactor-audit-v2
Apr 17, 2026
Merged

[codex] Add agent-friendly refactor audit routing#44
NeapolitanIcecream merged 4 commits intomainfrom
codex/agent-friendly-refactor-audit-v2

Conversation

@NeapolitanIcecream
Copy link
Copy Markdown
Owner

@NeapolitanIcecream NeapolitanIcecream commented Apr 17, 2026

Summary

  • upgrade scripts/refactor_audit.py from a static hotspot report into an agent-friendly routing queue with git history, change coupling, ambiguity signals, optional coverage, and subsystem summaries
  • add signal-health reporting plus compatibility-pressure scoring so compat-heavy files and missing coverage are surfaced explicitly in repo verdicts
  • split structural debt status from routing pressure, add basic shared-commit coupling denoising, and keep routing advice out of regression gating
  • preserve legacy run_refactor_audit(**legacy_kwargs) defaults and retain git-history scoring for explicit scoped files that sit outside the default audit target set
  • update docs and the checked-in refactor baseline to schema v2 so the workflow, baseline semantics, and current output stay aligned

Impact

  • the audit now answers which files an agent should touch next, not just which symbols look structurally large
  • repo verdict semantics are less ambiguous: debt_status is hotspot/baseline-driven, while routing_pressure remains advisory
  • coverage remains optional, but runs without --coverage-json are explicitly marked as partial-signal analyses
  • shared-commit coupling now filters obvious sweep commits by ignoring very large tracked-file commits
  • explicit scoped audits such as main.py keep their own churn and commit-frequency history instead of falling back to synthetic zeroes
  • the refreshed baseline tracks the new routing queue and current strained-but-non-regressing state

Follow-ups

  • routing weights and thresholds are still fixed in code for this PR; moving them into config is deferred follow-up work
  • scripts/refactor_audit.py is better segmented internally now, but a larger module split is also deferred follow-up work

Validation

  • uv run pytest tests/test_refactor_audit.py -q
  • uv run ruff check scripts/refactor_audit.py tests/test_refactor_audit.py
  • uv run pyright scripts/refactor_audit.py tests/test_refactor_audit.py
  • uv run python scripts/refactor_audit.py
  • uv run python scripts/refactor_audit.py --update-baseline
  • uv run python scripts/refactor_audit.py main.py --out-dir /tmp/recoleta-final-scope-check

@NeapolitanIcecream NeapolitanIcecream marked this pull request as ready for review April 17, 2026 06:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 623d4958b7

ℹ️ 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".

Comment thread scripts/refactor_audit.py Outdated
Comment thread scripts/refactor_audit.py Outdated
@NeapolitanIcecream NeapolitanIcecream merged commit d67fad3 into main Apr 17, 2026
4 checks passed
@NeapolitanIcecream NeapolitanIcecream deleted the codex/agent-friendly-refactor-audit-v2 branch April 17, 2026 08:00
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.

1 participant