Skip to content

feat(optimize-sorting): unified optimize-sorting workflow with CLI wiring and three fixes - #1443

Closed
colehurwitz wants to merge 1 commit into
mainfrom
feat/optimize-sorting-unified
Closed

colehurwitz wants to merge 1 commit into
mainfrom
feat/optimize-sorting-unified

Conversation

@colehurwitz

Copy link
Copy Markdown
Collaborator

Combines PRs #1430, #1433, #1435, #1442 into a single PR.

What this adds

Workflow (.factory/workflows/optimize_sorting.py)

Three-tier iterative speed optimization for spike sorting pipelines:

  • Tier 1: Config sweep (parameter tuning, zero code changes)
  • Tier 2: Code optimization (preserve algorithmic behavior)
  • Tier 3: Algorithm changes (strict 0.5% overall + 5% per-unit gates)

CLI wiring

  • Added optimize-sorting to CEO_MODES
  • Added mode suffix for task builder
  • Focus.txt routing for tier selection
  • WORKFLOW_META entry for SKILL generation
  • --focus allowlist support

Three fixes from #1442

  1. Standardized experiment storage (.factory/experiments/optimize-sorting.jsonl)
  2. Added to --focus mode allowlist
  3. Code-change attribution with 2σ variance detection in PR comments

Tests and docs

  • tests/test_optimize_sorting_workflow.py (61 tests, all passing)
  • workflow-optimize-sorting/SKILL.md (auto-generated)

Supersedes #1430, #1433, #1435, #1442

…ring and three fixes

Combines PRs #1430, #1433, #1435, #1442 into a single PR.

- Three-tier workflow (config sweep, code optimization, algorithm changes)
- Project-local workflow at .factory/workflows/optimize_sorting.py
- CLI wiring: CEO_MODES, mode suffix, focus.txt routing, WORKFLOW_META
- Standardized experiment storage at .factory/experiments/optimize-sorting.jsonl
- --focus allowlist support for tier targeting
- Code-change attribution in PR comments (2σ variance detection)
- Tests and SKILL.md included
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Sentrux Quality Report

Absolute

Scanning ....
[scan] git ls-files: 629 total, 615 kept, 14 dropped (ext:14, meta:0, big:0)
[build_project_map] 615 files, 111 unique dirs, 102 cache misses, 5.4ms
[resolve] 1154 resolved, 1573 unresolved (of 2727 total specs)
[resolve_imports] project_map 5.5ms, suffix_idx 1.5ms, suffix_resolve 18.8ms, total 25.8ms
[build_graphs] 615 files | maps 2.0ms, imports 26.0ms, calls+inherit 6.5ms, total 34.4ms | 1153 import, 8373 call, 1 inherit edges
sentrux check — 3 rules checked

Quality: 4449

✗ [Error] max_cc: 5 function(s) exceed max cyclomatic complexity of 30
    factory/cli/_ceo_helpers.py:_execute_ceo (cc=46)
    factory/cli/_ceo_helpers.py:_validate_ceo_flags (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: 629 total, 615 kept, 14 dropped (ext:14, meta:0, big:0)
[build_project_map] 615 files, 111 unique dirs, 102 cache misses, 5.6ms
[resolve] 1154 resolved, 1573 unresolved (of 2727 total specs)
[resolve_imports] project_map 5.7ms, suffix_idx 1.1ms, suffix_resolve 19.8ms, total 26.6ms
[build_graphs] 615 files | maps 2.3ms, imports 26.7ms, calls+inherit 6.2ms, total 35.2ms | 1153 import, 8373 call, 1 inherit edges
sentrux gate — structural regression check

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

Distance from Main Sequence: 0.35

✗ DEGRADED
  ✗ Complex functions increased: 67 → 68

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