# proxy/flow | 504 func | 12 pipelines | 9 hub-types | 2026-03-22

PIPELINES[12] (Core:7, IO:2, Unknown:3):
  Src [IO]: click.Context → float
              → browser_list(ctx:click.Context)         CC=1    pure ▶
              → cmd_browser_list(args)                  CC=6    IO
              → detect_all_profiles() → list[BrowserProfile] CC=1    mutation
              → detect_chromium_profiles() → list[BrowserProfile] CC=1    pure
              → _detect_chromium_family(base_dir:Path, browser:str) → list[BrowserProfile] CC=9    IO
              → _dir_size_mb(path:Path) → float         CC=4    pure ■
              PURITY: 3/6 pure  BOTTLENECK: _detect_chromium_family(CC=9)

  Src [Unknown]: ? → float
              → execute() → StreamingResponse | JSONResponse CC=1    pure ▶
              → _run() → StreamingResponse | JSONResponse CC=1    pure
              → _execute_with_fallbacks(kwargs:dict) → StreamingResponse | JSONResponse CC=4    pure
              → _make_stream_response(kwargs, model_spec, t0) → StreamingResponse CC=1    pure
              → _stream_wrapper(response_coro, model_spec, t0) CC=7    IO
              → _calculate_cost(model, prompt_tokens:int, completion_tokens:int) → float CC=1    pure ■
              PURITY: 5/6 pure  BOTTLENECK: _stream_wrapper(CC=7)

  Src [Core]: click.Context → Settings
              → vm_ssh(ctx:click.Context, vm_id:str, user:str) CC=1    pure ▶
              → cmd_vm_ssh(args)                        CC=2    pure
              → _find_vm(args)                          CC=6    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 3/5 pure  BOTTLENECK: _find_vm(CC=6)

  Src [Core]: click.Context → Settings
              → vm_logs(ctx:click.Context, vm_id:str)   CC=1    pure ▶
              → cmd_vm_logs(args)                       CC=1    pure
              → _find_vm(args)                          CC=6    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 3/5 pure  BOTTLENECK: _find_vm(CC=6)

  Src [IO]: VMConfig → Path | None
              → create_vm(config:VMConfig) → VMConfig   CC=4    pure ▶
              → _create_vm_clonebox(config:VMConfig) → None CC=11   IO
              → _inject_vm_config(config:VMConfig) → dict[str, Any] CC=9    IO
              → _load_profile_cloud_init(tool:str) → dict[str, Any] CC=3    pure
              → get_builtin_profile(tool:str) → Path | None CC=2    pure ■
              PURITY: 3/5 pure  BOTTLENECK: _create_vm_clonebox(CC=11)

  Src [Unknown]: ? → bool
              → list_vms() → list[VMStatus]             CC=3    pure ▶
              → get_status(vm_id:str) → VMStatus | None CC=6    pure
              → _refresh_state_clonebox(vm:VMConfig) → None CC=7    pure
              → _get_clonebox()                         CC=3    mutation
              → _check_clonebox() → bool                CC=3    mutation ■
              PURITY: 3/5 pure  BOTTLENECK: _refresh_state_clonebox(CC=7)

  Src [Unknown]: Request → list[str]
              → detect_context(request:Request)         CC=2    pure ▶
              → detect_project(messages:list[dict], headers:dict[str, str] | None) → ProjectContext CC=8    pure
              → _from_directory(directory:str) → ProjectContext CC=2    pure
              → _detect_stack(root:Path) → list[str]    CC=4    mutation
              → _detect_frameworks(root:Path) → list[str] CC=7    IO ■
              PURITY: 3/5 pure  BOTTLENECK: detect_project(CC=8)

  Src [Core]: click.Context → Settings
              → status(ctx:click.Context, fmt:str)      CC=1    pure ▶
              → cmd_status(args)                        CC=10   IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 2/4 pure  BOTTLENECK: cmd_status(CC=10)

  Src [Core]: click.Context → Settings
              → models(ctx:click.Context, fmt:str)      CC=1    pure ▶
              → cmd_models(args)                        CC=6    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 2/4 pure  BOTTLENECK: cmd_models(CC=6)

  Src [Core]: click.Context → Settings
              → accounts_list(ctx:click.Context)        CC=1    pure ▶
              → cmd_accounts_list(args)                 CC=6    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 2/4 pure  BOTTLENECK: cmd_accounts_list(CC=6)

  Src [Core]: click.Context → Settings
              → accounts_add(ctx:click.Context, name:str, provider:str, api_key:str, email:str, daily_budget:float, monthly_budget:float, tags:str) CC=1    pure ▶
              → cmd_accounts_add(args)                  CC=4    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 2/4 pure  BOTTLENECK: cmd_accounts_add(CC=4)

  Src [Core]: click.Context → Settings
              → accounts_costs(ctx:click.Context)       CC=1    pure ▶
              → cmd_accounts_costs(args)                CC=5    IO
              → make_client(base:str, key:str) → httpx.Client CC=3    pure
              → get_settings() → Settings               CC=2    mutation ■
              PURITY: 2/4 pure  BOTTLENECK: cmd_accounts_costs(CC=5)


TRANSFORMS (fan-out ≥10):
  cmd_status(args)                                        fan=21   !! side-effects
  useDashboardData()                                      fan=20   !! side-effects
  VMsPanel()                                              fan=18   fan=18
  detect_firefox_profiles() → list[BrowserProfile]        fan=17   fan=17
  _detect_chromium_family(base_dir:Path, browser:str) → list[BrowserProfile] fan=17   fan=17
  _create_vm_clonebox(config:VMConfig) → None             fan=16   PIPELINE:_LifecycleMixin.entry
  analyze_request(messages:list[dict]) → AnalysisResult   fan=15   fan=15
  sortColumn()                                            fan=15   fan=15
  table()                                                 fan=15   fan=15
  table_body_rows()                                       fan=15   fan=15
  no_rows()                                               fan=15   fan=15
  footer()                                                fan=15   fan=15
  ratio_columns()                                         fan=15   fan=15
  filter_handler()                                        fan=15   fan=15
  get_logs(lines:int, level:str | None)                   fan=14   fan=14

CONTRACTS:
  Pipeline: Src
    browser_list(ctx:click.Context)
      IN:  ctx:click.Context
      OUT: None

    cmd_browser_list(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, print)

    detect_all_profiles() → list[BrowserProfile]
      IN:  ()
      OUT: list[BrowserProfile]
      SIDE-EFFECT: pure

    detect_chromium_profiles() → list[BrowserProfile]
      IN:  ()
      OUT: list[BrowserProfile]

    _detect_chromium_family(base_dir:Path, browser:str) → list[BrowserProfile]
      IN:  base_dir:Path, browser:str
      OUT: list[BrowserProfile]
      SIDE-EFFECT: IO(loads, read_text)

    _dir_size_mb(path:Path) → float
      IN:  path:Path
      OUT: float

  Pipeline: Src
    execute() → StreamingResponse | JSONResponse
      IN:  ()
      OUT: StreamingResponse | JSONResponse

    _run() → StreamingResponse | JSONResponse
      IN:  ()
      OUT: StreamingResponse | JSONResponse

    _execute_with_fallbacks(kwargs:dict) → StreamingResponse | JSONResponse
      IN:  kwargs:dict
      OUT: StreamingResponse | JSONResponse

    _make_stream_response(kwargs, model_spec, t0) → StreamingResponse
      IN:  kwargs, model_spec, t0
      OUT: StreamingResponse

    _stream_wrapper(response_coro, model_spec, t0)
      IN:  response_coro, model_spec, t0
      OUT: None
      SIDE-EFFECT: IO(dumps); generator

    _calculate_cost(model, prompt_tokens:int, completion_tokens:int) → float
      IN:  model, prompt_tokens:int, completion_tokens:int
      OUT: float

  Pipeline: Src
    vm_ssh(ctx:click.Context, vm_id:str, user:str)
      IN:  ctx:click.Context, vm_id:str, user:str
      OUT: None

    cmd_vm_ssh(args)
      IN:  args
      OUT: None

    _find_vm(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    vm_logs(ctx:click.Context, vm_id:str)
      IN:  ctx:click.Context, vm_id:str
      OUT: None

    cmd_vm_logs(args)
      IN:  args
      OUT: None

    _find_vm(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    create_vm(config:VMConfig) → VMConfig
      IN:  config:VMConfig
      OUT: VMConfig

    _create_vm_clonebox(config:VMConfig) → None
      IN:  config:VMConfig
      OUT: None
      SIDE-EFFECT: IO(write_text, unlink)

    _inject_vm_config(config:VMConfig) → dict[str, Any]
      IN:  config:VMConfig
      OUT: dict[str, Any]
      SIDE-EFFECT: IO(loads, dumps)

    _load_profile_cloud_init(tool:str) → dict[str, Any]
      IN:  tool:str
      OUT: dict[str, Any]

    get_builtin_profile(tool:str) → Path | None
      IN:  tool:str
      OUT: Path | None

  Pipeline: Src
    list_vms() → list[VMStatus]
      IN:  ()
      OUT: list[VMStatus]

    get_status(vm_id:str) → VMStatus | None
      IN:  vm_id:str
      OUT: VMStatus | None

    _refresh_state_clonebox(vm:VMConfig) → None
      IN:  vm:VMConfig
      OUT: None

    _get_clonebox()
      IN:  ()
      OUT: None
      SIDE-EFFECT: mutates self._clonebox

    _check_clonebox() → bool
      IN:  ()
      OUT: bool
      SIDE-EFFECT: global(_CLONEBOX_AVAILABLE)
      INVARIANT: raises on invalid input

  Pipeline: Src
    detect_context(request:Request)
      IN:  request:Request
      OUT: None

    detect_project(messages:list[dict], headers:dict[str, str] | None) → ProjectContext
      IN:  messages:list[dict], headers:dict[str, str] | None
      OUT: ProjectContext

    _from_directory(directory:str) → ProjectContext
      IN:  directory:str
      OUT: ProjectContext

    _detect_stack(root:Path) → list[str]
      IN:  root:Path
      OUT: list[str]
      SIDE-EFFECT: pure

    _detect_frameworks(root:Path) → list[str]
      IN:  root:Path
      OUT: list[str]
      SIDE-EFFECT: IO(read_text)

  Pipeline: Src
    status(ctx:click.Context, fmt:str)
      IN:  ctx:click.Context, fmt:str
      OUT: None

    cmd_status(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, print, print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    models(ctx:click.Context, fmt:str)
      IN:  ctx:click.Context, fmt:str
      OUT: None

    cmd_models(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, dump)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    accounts_list(ctx:click.Context)
      IN:  ctx:click.Context
      OUT: None

    cmd_accounts_list(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    accounts_add(ctx:click.Context, name:str, provider:str, api_key:str, email:str, daily_budget:float, monthly_budget:float, tags:str)
      IN:  ctx:click.Context, name:str, provider:str, api_key:str, email:str, daily_budget:float, monthly_budget:float, tags:str
      OUT: None

    cmd_accounts_add(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)

  Pipeline: Src
    accounts_costs(ctx:click.Context)
      IN:  ctx:click.Context
      OUT: None

    cmd_accounts_costs(args)
      IN:  args
      OUT: None
      SIDE-EFFECT: IO(print, print, print)

    make_client(base:str, key:str) → httpx.Client
      IN:  base:str, key:str
      OUT: httpx.Client

    get_settings() → Settings
      IN:  ()
      OUT: Settings
      SIDE-EFFECT: global(_settings)


DATA_TYPES (by cross-function usage) [297 annotated, 3 inferred / 504 functions]:
  str                  consumed:158 produced:35   !! HUB-TYPE → split interface
  int                  consumed:29  produced:2    !! HUB-TYPE → split interface
  bool                 consumed:7   produced:20 
  dict                 consumed:17  produced:10   !! HUB-TYPE → split interface
  str | None           consumed:17  produced:6    !! HUB-TYPE → split interface
  list[str]            consumed:13  produced:9    !! HUB-TYPE → split interface
  float                consumed:19  produced:3    !! HUB-TYPE → split interface
  click.Context        consumed:22  produced:0    !! HUB-TYPE → split interface
  dict[str, Any]       consumed:3   produced:17 
  VMConfig             consumed:14  produced:1    !! HUB-TYPE → split interface
  list[dict]           consumed:10  produced:2    !! HUB-TYPE → split interface
  CloneBoxResult       consumed:0   produced:11   output-heavy
  Path                 consumed:9   produced:0    input-heavy (read-only flow)
  AnalysisResult       consumed:5   produced:3  
  Request              consumed:7   produced:0    input-heavy (read-only flow)
  dict[str, FileSnapshot] consumed:6   produced:1    input-heavy (read-only flow)
  ProjectContext       consumed:2   produced:3  
  list[BrowserProfile] consumed:0   produced:5    output-heavy
  list                 consumed:4   produced:0    narrow scope
  Account              consumed:2   produced:2    narrow scope

  HUB TYPES (consumed ≥10):
    str → 158 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    int → 29 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    dict → 17 consumers → split into:
      - replace with typed alternatives (dataclass/TypedDict)
    str | None → 17 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    list[str] → 13 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    float → 19 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    click.Context → 22 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    VMConfig → 14 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)
    list[dict] → 10 consumers → split into:
      - (analyze consumers to suggest sub-interfaces)

SIDE_EFFECTS:
  IO:        FileSnapshot.from_path, detect_firefox_profiles, _detect_chromium_family, _scan_firefox_cookies, _scan_chrome_cookies, _InfraMixin._generate_domain_xml, _LifecycleMixin._create_vm_clonebox, _SnapshotMixin.delete_vm, _ConfigMixin._inject_vm_config, _ConfigMixin._save_vm_key_mapping
  Cache:     get, post, stored_list
  Mutation:  _make_args, DeltaBuffer.__init__, DeltaBuffer.compute_delta, DeltaBuffer._classify_changes, DeltaBuffer._build_diff_text, DeltaBuffer._build_full_context, AuthMiddleware.__init__, detect_all_profiles, _check_clonebox, CloneBoxAdapter.__init__
  Pure:      cli, serve, status, models, accounts, accounts_list, accounts_add, accounts_costs, vm, vm_list

  PIPELINE PURITY:
    Src             ██░░ 50% pure
    Src             ███░ 83% pure
    Src             ██░░ 60% pure
    Src             ██░░ 60% pure
    Src             ██░░ 60% pure
    Src             ██░░ 60% pure
    Src             ██░░ 60% pure
    Src             ██░░ 50% pure
    Src             ██░░ 50% pure
    Src             ██░░ 50% pure
    Src             ██░░ 50% pure
    Src             ██░░ 50% pure
