Skip to content

refactor(tests): reduce complexity debt in test suites - #5047

Merged
Trecek merged 9 commits into
developfrom
impl-issue-4993-complexity-debt-20260914-231408
Sep 15, 2026
Merged

Trecek merged 9 commits into
developfrom
impl-issue-4993-complexity-debt-20260914-231408

Conversation

@Trecek

@Trecek Trecek commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactor the test/support complexity debt tracked in #4993 across 37 files. Shared scope-selection, AST-scanning, fixture, fault-injection, and routing operations replace duplicated logic while preserving existing assertions, diagnostics, ordering, and cleanup.

  • Lowered scores for 45 candidate identities, removed two unused helpers, and left one already-reduced candidate unchanged.
  • Added the two planned regression tests and extended the existing hook-alias fixture.
  • Kept production code, thresholds, and exemptions unchanged. The backend double's 33→1 caller score comes from moving its definition; its 32 methods remain at complexity 1.

The issue body contains all 48 candidate measurements and all introduced or relocated function measurements.

Local validation

  • pre-commit run --all-files: passed.
  • Affected gate: 6,341 passed, 104 skipped, 3 xfailed.
  • Full configured local gate: 47,698 passed, 784 skipped, 34 xfailed; filtering disabled, configured Channel B exclusion retained.
  • Supplemental checks against the captured base: 53 passed, covering three checks skipped in the full run for missing base context.
  • Complexity checker: warning-only exit 0, with four extracted helpers above 10: source cascade (20), per-guard authority checks (17), shell outcome validation (11), and routing-target iteration (11).

Outstanding smoke validation

Both credentialed live smoke cases failed:

  • Codex: unsuccessful session result before event normalization; the saved error dictionary does not establish the underlying refusal reason.
  • Claude: one recognized subagent launch where the existing assertion requires at least two. Replaying its 130 raw events through the original and refactored normalizers produces identical 40-event output, including that one launch.

The smoke setup and live test body are unchanged. Assertions and launch-name sets were preserved, and no passing smoke result is claimed.

Refs #4993.

@Trecek
Trecek added this pull request to the merge queue Sep 15, 2026
Merged via the queue into develop with commit d112a78 Sep 15, 2026
8 checks passed
@Trecek
Trecek deleted the impl-issue-4993-complexity-debt-20260914-231408 branch September 15, 2026 15:52
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