Skip to content

fix(optimize-sorting): standardize experiment storage, add --focus allowlist, add attribution column - #1442

Closed
colehurwitz wants to merge 1 commit into
mainfrom
factory/run-fd0799c1
Closed

colehurwitz wants to merge 1 commit into
mainfrom
factory/run-fd0799c1

Conversation

@colehurwitz

Copy link
Copy Markdown
Collaborator

Closes #1441

Changes

  • Fix 1: Standardize Experiment Storage — Updated 9 path references from .factory/sorting/experiments.jsonl to .factory/experiments/optimize-sorting.jsonl. Added migrate_experiments FnNode for one-time migration (shutil.copy2 preserves old file). Updated edge wiring: lock_baseline → migrate_experiments → select_tier. Added experiments file to select_tier reads set.

  • Fix 2: Add optimize-sorting to --focus Mode Allowlist — Added "optimize-sorting" to the tuple in _validate_late_flags() and updated the error message string.

  • Fix 3: Cross-Reference Code Changes vs Stage Speedups — Inserted attribution logic into _ARCHIVE_RESULT_PROMPT_TEMPLATE that cross-references git diff HEAD~1 --name-only against stage names with 2σ noise threshold. Replaced Status column with Attribution column in PR comment table. Added attribution summary after the table.

Verification

Check Result
factory workflow validate optimize-sorting ✅ VALID (32 nodes, 40 edges)
factory workflow export-skills ✅ SKILL.md regenerated
Zero matches for old path (sorting/experiments.jsonl)
optimize-sorting in --focus allowlist
Attribution column in PR comment table
ruff check on both files ✅ All checks passed
Core tests (422) ✅ All passed

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Sentrux Quality Report

Absolute

Scanning ....
[scan] git ls-files: 628 total, 614 kept, 14 dropped (ext:14, meta:0, big:0)
[build_project_map] 614 files, 111 unique dirs, 102 cache misses, 3.5ms
[resolve] 1153 resolved, 1570 unresolved (of 2723 total specs)
[resolve_imports] project_map 3.7ms, suffix_idx 1.2ms, suffix_resolve 18.7ms, total 23.6ms
[build_graphs] 614 files | maps 2.5ms, imports 23.7ms, calls+inherit 6.8ms, total 33.0ms | 1152 import, 8372 call, 1 inherit edges
sentrux check — 3 rules checked

Quality: 4448

✗ [Error] max_cc: 5 function(s) exceed max cyclomatic complexity of 30
    factory/cli/_ceo_helpers.py:_validate_ceo_flags (cc=43)
    factory/cli/_ceo_helpers.py:_execute_ceo (cc=43)
    examples/chess_evolve.py:main (cc=33)
    factory/cli/_task_builder.py:_build_ceo_task (cc=32)
    factory/outer_loop/mutations.py:validate_and_repair (cc=31)

✗ 1 violation(s) found

Diff (vs base branch)

Scanning ....
[scan] git ls-files: 628 total, 614 kept, 14 dropped (ext:14, meta:0, big:0)
[build_project_map] 614 files, 111 unique dirs, 102 cache misses, 3.7ms
[resolve] 1153 resolved, 1570 unresolved (of 2723 total specs)
[resolve_imports] project_map 3.8ms, suffix_idx 1.2ms, suffix_resolve 19.5ms, total 24.6ms
[build_graphs] 614 files | maps 2.5ms, imports 24.7ms, calls+inherit 7.0ms, total 34.3ms | 1152 import, 8372 call, 1 inherit edges
sentrux gate — structural regression check

Quality:      4449 -> 4448
Coupling:     0.80 → 0.80
Cycles:       4 → 4
God files:    2 → 2

Distance from Main Sequence: 0.35

✓ No degradation detected

@colehurwitz
colehurwitz force-pushed the factory/run-fd0799c1 branch 3 times, most recently from b08eef5 to 387e3e9 Compare September 2, 2026 14:13
@colehurwitz

Copy link
Copy Markdown
Collaborator Author

Superseded by unified PR — see #1443

@colehurwitz colehurwitz closed this Sep 2, 2026
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.

fix(optimize-sorting): standardize experiment storage, add --focus allowlist, add attribution column

1 participant