Repository navigation
feat(cluster): bunch-search-based modularization (tasks 5-7) - #248
Merged
Merged
Conversation
- dispatch ClusterAlgorithm from clustering.algorithm/seed/bunch.* with CLI precedence; file cap reports BunchSkip and falls back to Leiden - add --cluster-algorithm, --seed and --bunch-* build flags plus the clustereval landscape subcommand with atomic landscape.json and markdown summary - print a Partition quality line computed from the exported CommunityMap - record landscape/threshold/annealing smoke results and test evidence in the openspec tasks Co-Authored-By: Paperclip <noreply@paperclip.ing>
…landscape) Wire the Bunch clustering algorithm end to end and archive the change. - Build flags --cluster-algorithm leiden|bunch, --seed, --bunch-population, --bunch-threshold (0..100), --bunch-sa T0,ALPHA, --bunch-max-iterations, --bunch-max-files, --bunch-weighted; graphos.yaml clustering.algorithm, clustering.seed, clustering.bunch.* with CLI precedence and validation - Cluster stage dispatches through runClustering (Leiden stays byte-identical), logs a Bunch skip above the file cap, and re-scores the final capped partition into Analysis.analysisPartitionQuality - GRAPH_REPORT.md: "Partition quality (<algo>): MQ, modularity, intra-edge fraction" plus a Bunch-skip line - graphos clustereval landscape: runs, basins, edge similarity, random baseline, Leiden point; landscape.json written atomically or --json - Fix UseCase/ClusterEval.hs, which did not compile on main (invalid string escape, two type errors) - Basin cluster range is now min..max instead of first/last run - Spec: replace the infeasible bip:100:0.75 = 3,712 scenario with bip:100:0.25 = 1,237 and a saturation scenario (2,500) - Smoke results (landscape, eta/annealing sweep) recorded in tasks.md; change archived to openspec/changes/archive/2026-11-11-...
The export path re-derived the algorithm name from config, so a Bunch run that fell back to Leiden above --bunch-max-files was reported as algorithm=bunch with no skip. The pipeline already computed the correct ClusterQuality from the partition actually written (coQuality) but never read it. Move ClusterQuality/BunchSkip to Graphos.Domain.Community.Quality, thread the stage's record through exportAll/epExportAll on the full, --cluster-only, incremental and merge paths, and render it instead of recomputing from config. The report now also names the skip on the Leiden fallback. Add an ExportSpec regression for that path. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Owner
Author
Review fix — AVI-95 changes requested (head
|
…dularization-finish feat: finish bunch-search-based-modularization (CLI, config, report, landscape)
…icts, AVI-99) main already finished and archived bunch-search-based-modularization in #249 (CLI/config wiring, ClusterQuality in Domain.Types.Analysis, report line and landscape). This merge adopts main's implementation of tasks 5-7 wholesale and keeps PR #248's lane evidence: the archived tasks.md gains the AVI-65 verification record (validation at head 1f27f6c, AVI-95 review fix history, landscape smokes), marked superseded where it described the pre-resolution implementation. Code and tests after this merge are identical to main@bb5597a; the only delta is openspec/changes/archive/2026-11-11-bunch-search-based-modularization/tasks.md. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.
Summary
Completes the
bunch-search-based-modularizationOpenSpec change (tasks 5–7): Bunch orchestration inUseCase/Cluster.hs, thelandscapeevaluation path inUseCase/ClusterEval.hs, CLI/config wiring, partition-quality report lines, and the recorded validation evidence.Leiden remains the default. Bunch is opt-in via
--cluster-algorithm bunch/clustering.algorithm: bunch.Scope
ClusterAlgorithm = Leiden | Bunch BunchSettingsdispatch fromclustering.algorithm/seed/bunch.*, CLI wins over config.BunchSkipand falls back to Leiden; symbols are pushed back to their file's cluster.ClusterQuality(algorithm, MQ, modularity, intra-edge fraction) printed from the sameCommunityMapthe export writes.clustereval landscape(--graph,--runs,--seed,--random-partitions,--random-graph,--json,--out) with atomiclandscape.jsonand a markdown summary.--cluster-algorithm,--seed,--bunch-population,--bunch-threshold,--bunch-sa,--bunch-max-iterations,--bunch-max-files,--bunch-weighted.Out of scope (per issue): Bunch subsystem hierarchy, omnipresent-module isolation, GA search, MoJo/EdgeSim/MeCl, changing the default algorithm.
Validation
Recorded in
openspec/changes/bunch-search-based-modularization/tasks.md:cabal build --flag dev all(-Werror): green in the prior run; re-run on this rebased branch below.cabal test: 1608 examples, 0 failures, 4 pending, after excluding two pre-existing unrelated issues (TypeScript grammars failure; a non-terminatingBoundedDeltaCommunitySpecproperty). Both scaffold golden fixtures updated by this change are green.openspec validate bunch-search-based-modularization --strict: exit 0.rnd:100:0.5; Leiden point MQ 7.7619 / 1,164 clusters. η ∈ {0,50,100} and annealing runs recorded intasks.md.This run
991f3d5onto currentmain(5a2e3af, PR openspec: Bunch search-based modularization proposal #241 with tasks 0–4) asab6df994f0363755cae2354811645d0d5df3f69f.openspec validate ... --strict: exit 0.cabal build --flag dev all: green (needed--constraint="zlib +bundled-c-zlib"in this sandbox because the system zlib headers are absent; CI/devenv supplies them).clustereval landscape --random-graph rnd:100:0.05 --runs 5 --random-partitions 50 --jsonwrotelandscape.jsonwithruns/similarity/basins/random_baseline/config(leidencorrectly absent on a control graph); a Bunch build on a tiny tree printedPartition quality: algorithm=bunch ...;--bunch-max-files 1warnedBunch skipped: 3 files exceeds --bunch-max-files 1; running Leidenand fell back.cabal test: 1615 examples, 4 failures, 4 pending with two pre-existing issues skipped (small random graphsproperty that does not terminate; the pre-existing TypeScript grammar case). All 4 remaining failures are inGrammarsSpec(PHP/Perl/C# vendored grammar tests, files untouched by this change). Change-relevant specs are green: Bunch 22/0, Landscape 3/0, modularization 23/0, cluster 44/0, parser 12/0, config 25/0, report 36/0, determinism 17/0, permutation 6/0; the focus suite is 19/0.Notes for the reviewer
graphos-keepervia the merge-gate skill.