Skip to content

Tighten branch rewrite topology pressure#231

Merged
SoundBlaster merged 2 commits into
mainfrom
codex/branch-rewrite-pressure-threshold
May 7, 2026
Merged

Tighten branch rewrite topology pressure#231
SoundBlaster merged 2 commits into
mainfrom
codex/branch-rewrite-pressure-threshold

Conversation

@SoundBlaster

Copy link
Copy Markdown
Member

Summary

Motivation

  • SG-SPEC-0045 still appeared as a branch rewrite candidate after two bounded cleanup runs because bookkeeping hits only slightly exceeded role hits.
  • That created a false positive and would waste future supervisor cycles on an already readable node.

Goals

  • Require dominant topology/bookkeeping pressure before raising branch rewrite topology pressure.
  • Preserve detection for genuinely topology-dominant specs.
  • Out of scope: changing branch rewrite policy vocabulary or existing candidate schema.

Changes

  • Added a 1.5x bookkeeping-to-role ratio gate to branch rewrite topology pressure.
  • Added regression tests for the near-balanced SG-SPEC-0045 profile and a dominant topology profile.

Validation

  • Tests added/updated for changed behavior
  • Local checks passed

Commands run:

python3 -m ruff check tools/supervisor.py tests/test_supervisor.py
python3 -m ruff format --check tools/supervisor.py tests/test_supervisor.py
python3 -m pytest -q tests/test_supervisor.py -k 'branch_rewrite_topology_pressure or branch_rewrite_candidate or build_branch_rewrite_preview'
python3 tools/supervisor.py --build-branch-rewrite-preview --target-spec SG-SPEC-0045
make test

Results:

  • ruff check passed
  • ruff format passed
  • focused tests: 11 passed, 464 deselected
  • SG-SPEC-0045 branch rewrite preview: candidate_count=0, preview_status=no_candidates
  • make test: 567 passed

Risks / Notes

  • Backward compatibility impact: none expected; only narrows a derived advisory signal.
  • Migration/config changes required: none.
  • Known limitations: the ratio threshold is intentionally conservative and covered by regression examples.

Checklist

  • PR title clearly describes the change
  • Scope is focused and minimal
  • Documentation updated (or N/A)
  • No secrets or sensitive data added

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the branch-rewrite “topology pressure” heuristic so near-balanced bookkeeping/role text no longer triggers rewrite candidacy, reducing false positives in the SG-SPEC-0045 rewrite loop.

Changes:

  • Add a bookkeeping-to-role ratio gate (>= 1.5x) to branch_rewrite_topology_pressure.
  • Add regression tests covering a near-balanced profile (should not flag) and a topology-dominant profile (should flag).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tools/supervisor.py Tightens topology-pressure classification with an additional ratio threshold to reduce false positives.
tests/test_supervisor.py Adds targeted regression tests to lock in the new topology-pressure behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/supervisor.py Outdated
Comment thread tools/supervisor.py Outdated
@SoundBlaster SoundBlaster force-pushed the codex/supervisor-run-26 branch from d96c962 to 2c360a5 Compare May 7, 2026 20:15
@SoundBlaster SoundBlaster force-pushed the codex/branch-rewrite-pressure-threshold branch from eb2621f to 05afab6 Compare May 7, 2026 20:17
@SoundBlaster SoundBlaster changed the base branch from codex/supervisor-run-26 to main May 7, 2026 20:17
@SoundBlaster SoundBlaster merged commit f4faff7 into main May 7, 2026
2 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.

2 participants