Skip to content

refactor(policies): decompose poll_next de HitStream en phases#111

Merged
Destynova2 merged 1 commit intodevelopfrom
refactor/decompose-poll-next
Apr 10, 2026
Merged

refactor(policies): decompose poll_next de HitStream en phases#111
Destynova2 merged 1 commit intodevelopfrom
refactor/decompose-poll-next

Conversation

@Destynova2
Copy link
Copy Markdown
Contributor

Contexte

CC-2 du plan cli-cycle : poll_next de HitStream etait une god function (317 LOC, nesting 13).
Identifie par cli-audit-tangle comme le noeud d'enchevetrement principal (score tangle 55/100).

Changements

Extraction de 5 methodes privees :

  • poll_paused_approval (~55 LOC) : resout le oneshot d'approbation humaine
  • apply_hit_decision (~55 LOC) : dispatche AutoApprove/Deny/RequireApproval
  • apply_require_approval (~60 LOC) : gere les methodes d'auth
  • enter_paused (~15 LOC) : transition vers l'etat Paused
  • check_flag_patterns (~25 LOC) : scan text_delta pour patterns flags

Resultat : poll_next passe de ~317 LOC / nesting 13 a ~100 LOC / nesting 6.
Refactoring pur — semantique inchangee.

Tests

929 tests passent (cargo test --lib + nextest CI profile).

Extrait 5 fonctions privees de la god function poll_next (317 LOC, nesting 13) :
- poll_paused_approval : resout le oneshot d'approbation humaine (~55 LOC)
- apply_hit_decision : dispatche AutoApprove/Deny/RequireApproval (~55 LOC)
- apply_require_approval : gere les methodes d'auth (~60 LOC)
- enter_paused : transition vers l'etat Paused avec canal oneshot (~15 LOC)
- check_flag_patterns : scan les text_delta pour les patterns flags (~25 LOC)

poll_next passe de ~317 LOC / nesting 13 a ~100 LOC / nesting 6.
Semantique inchangee : memes inputs, memes outputs.
@Destynova2 Destynova2 merged commit 136b996 into develop Apr 10, 2026
38 checks passed
@Destynova2 Destynova2 deleted the refactor/decompose-poll-next branch April 10, 2026 19:44
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