You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: 4.0.0 Status: Final Release Date: November 2025 Author: Walmir Silva Architecture: ARFA 1.3 (Adaptive Reactive Flow Architecture) License: MIT
1. Overview
KaririCode\ProcessorPipeline is the composition engine of the KaririCode Framework. It provides a context-based processor registry, a flexible builder, and an immutable execution pipeline. Every component in the DPO triad (Validator, Sanitizer, Transformer) depends on ProcessorPipeline for processor orchestration.
Algorithm: Sequential Pipeline Execution
Input: pipeline π with processors [P₀..Pₙ₋₁], data d
Output: transformed data d' | PipelineExecutionException
1. state ← d
2. FOR i ← 0 TO n-1 DO
3. TRY
4. state ← π.processors[i].process(state)
5. CATCH throwable
6. RAISE PipelineExecutionException(stage=i, processor=Pᵢ.class, cause=throwable)
7. END TRY
8. END FOR
9. RETURN state
Complexity: O(n·p) where n = |processors|, p = avg processor cost Space: O(1) additional (state variable reused)
Theorem 4.1.1 (Termination):
Pipeline execution terminates in bounded time if every Pᵢ terminates.
Proof: The loop iterates exactly n times (finite). Each iteration executes exactly one process() call. If Pᵢ terminates, the iteration completes. By induction, all n iterations complete. ∎
4.2 Specification Resolution
Algorithm: Resolve Processor Specification
Input: specs = array<int|string, mixed>, registry R, context C
Output: List<Processor>
1. result ← []
2. FOR EACH (key, value) IN specs DO
3. CASE (typeof key, typeof value):
4. (int, string) → name ← value; config ← null
5. (string, false) → CONTINUE // disabled
6. (string, true) → name ← key; config ← null
7. (string, array) → name ← key; config ← value
8. OTHERWISE → CONTINUE // unknown format
9. END CASE
10. processor ← R.get(C, name) // may throw ProcessorNotFoundException
11. IF config ≠ null THEN
12. ASSERT processor instanceof ConfigurableProcessor
13. processor.configure(config)
14. END IF
15. result.append(processor)
16. END FOR
17. RETURN result