refactor(policies): decompose poll_next de HitStream en phases#111
Merged
Destynova2 merged 1 commit intodevelopfrom Apr 10, 2026
Merged
refactor(policies): decompose poll_next de HitStream en phases#111Destynova2 merged 1 commit intodevelopfrom
Destynova2 merged 1 commit intodevelopfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
CC-2 du plan cli-cycle :
poll_nextde 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 humaineapply_hit_decision(~55 LOC) : dispatche AutoApprove/Deny/RequireApprovalapply_require_approval(~60 LOC) : gere les methodes d'authenter_paused(~15 LOC) : transition vers l'etat Pausedcheck_flag_patterns(~25 LOC) : scan text_delta pour patterns flagsResultat : 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).