Skip to content

Treat explicit clusters as atomic aggregates#386

Merged
SoundBlaster merged 1 commit into
mainfrom
codex/sg-spec-0063-retrospective-refactor-proposal
May 16, 2026
Merged

Treat explicit clusters as atomic aggregates#386
SoundBlaster merged 1 commit into
mainfrom
codex/sg-spec-0063-retrospective-refactor-proposal

Conversation

@SoundBlaster
Copy link
Copy Markdown
Member

Summary

  • What changed? Treat explicit semantic cluster specs as valid atomic aggregates when their blocking dependencies are declared member_contracts.
  • Link related issue/task (if any): follow-up from make next-move on SG-SPEC-0063 / propose_retrospective_refactor.

Motivation

  • Why is this change needed? SG-SPEC-0063 is an intentional realization/observation cluster with four member specs, but the generic atomicity validator treated four blocking children as split pressure.
  • What problem, gap, or user need does it address? Prevents graph-health from pushing a valid semantic cluster into an impossible retrospective split proposal.

Goals

  • What should this PR achieve? Remove the false-positive retrospective_refactor_candidate for explicit cluster aggregates while preserving atomicity pressure for ordinary broad hubs.
  • What is intentionally out of scope? Raising the global atomicity_max_blocking_children threshold or changing canonical spec topology.

Changes

  • Add explicit cluster-member dependency detection to tools/supervisor.py.
  • Exempt only dependencies that are declared as specification.member_contracts under a cluster_contract.
  • Add regression tests covering atomicity validation and graph-health behavior for explicit cluster aggregates.

Validation

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

Commands run:

python3 -m pytest -q tests/test_supervisor.py -k 'cluster_member_dependencies or explicit_cluster_aggregate or healthy_multi_child_aggregate'
python3 - <<'PY'
import tools.supervisor as s
specs=s.load_specs()
idx=s.index_specs(specs)
node=idx['SG-SPEC-0063']
print('atomicity', s.validate_atomicity(node))
print('fanout', s.fan_out_legibility_profile(node,specs))
health=s.inspect_canonical_graph_health(node=node,specs=specs)['graph_health']
print('signals', health['signals'])
print('actions', health['recommended_actions'])
print('observations', [o['kind'] for o in health['observations']])
PY
git diff --check
make backlog
make next-move
ruff check tools/supervisor.py tests/test_supervisor.py
python3 -m compileall tools/supervisor.py
python3 -m pytest -q tests/test_supervisor.py

Results:

  • Focused tests: 3 passed, 604 deselected
  • Real SG-SPEC-0063 check: atomicity [], signals [], actions [], observation healthy_multi_child_aggregate
  • make backlog: entry_count dropped from 97 to 31; SG-SPEC-0063 health item disappeared
  • make next-move: now recommends proposal 0021 reobservation instead of SG-SPEC-0063
  • ruff and compileall passed
  • Full supervisor tests: 607 passed in 291.52s

Risks / Notes

  • Backward compatibility impact: Ordinary specs with too many undeclared blocking dependencies still fail atomicity.
  • Migration/config changes required: None.
  • Known limitations: Explicit cluster detection depends on specification.cluster_contract plus specification.member_contracts; informal prose-only clusters are not exempt.

Checklist

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

@SoundBlaster SoundBlaster merged commit b35411b into main May 16, 2026
5 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.

1 participant