Skip to content

Quality: RSI controller decomposition (tests-first) #126

Closed

Description

@w4ffl35

Target: src/rsi/controller.ts (694 standards violations, 19 complexity/nesting findings) plus src/rsi/inference-broker.ts (278 / 13) if time permits. Inventory: npm run check-standards, npm run check-architecture.

Brief:

  1. Measure: run npm run coverage -- --filter rsi and record the module percentage.
  2. Tests FIRST: add missing unit tests for every function you will touch (repo style: src//tests/.test.ts via tsx, auto-discovered). Do not reshape anything until its tests exist and pass.
  3. Refactor toward docs/typescript-standards.md (file 250 lines, function 20, complexity 10): extract cohesive modules (planning, selection, broker grants, reporting). No behavior change; keep all call sites compiling.
  4. Gates, all green: npx tsc --noEmit; npm test (full); npm run check-standards; npm run check-architecture; regenerate both baselines in the same change; coverage must not regress (npm run coverage -- --min 24).

Activity

  1. added a commit that references this issue on Oct 13, 2026
  2. w4ffl35 commented on Oct 13, 2026

    @w4ffl35
    MemberAuthor

    Partial progress landed via #151 (merged): candidates/fleet/integrity/proof slices extracted from controller.ts with tests-first coverage, both baselines regenerated. controller.ts is now 1410 lines — still far from the 250-line target — and inference-broker.ts (866 lines) is untouched. Keeping this open for the remaining extraction (planning, selection, broker grants, reporting). #127 closed via #148/#149.

  3. w4ffl35 commented on Oct 13, 2026

    @w4ffl35
    MemberAuthor

    RSI self-repair loop status: the eval baseline is green two runs in a row after the sandbox fixes (#152 PTY skip, #153 abort fallback, #154 watcher fixture kill, #155 pause flake widening) plus operator fixes (30-min trial timeout, clean-checkout requirement now tracked in #156, broker env for the development benchmark). Genuine selection pressure confirmed: c02 of run 4130236a was correctly rejected on a broken regression gate, and c01 passed regression before hitting the (now fixed) broker env gap. A fresh run with all fixes is in flight to attempt the first real selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions