Module

utils.observability.progress

Progress reporting system for build progress tracking.

Provides protocol-based progress reporting with multiple implementations (CLI, server, noop for tests). Enables consistent progress reporting across different execution contexts.

Key Concepts:

  • Progress protocol: Protocol-based interface for progress reporting
  • Phase tracking: Build phase tracking with progress updates
  • Multiple implementations: CLI, server, noop, rich reporters
  • Adapter pattern: LiveProgressManager adapter for compatibility

Related Modules:

  • bengal.utils.live_progress: Live progress manager implementation
  • bengal.orchestration.build: Build orchestration using progress reporting
  • bengal.cli.commands.build: CLI build command using progress reporting

See Also:

  • bengal/protocols/infrastructure.py: ProgressReporter protocol definition
  • NoopReporter: Test-friendly implementation in this module

Classes

NoopReporter 5
No-op progress reporter implementation. Provides safe default implementation that does nothing, su…

No-op progress reporter implementation.

Provides safe default implementation that does nothing, suitable for tests and quiet modes. All methods are no-ops that return immediately.

Creation: Direct instantiation: NoopReporter()

  • Created as default reporter when no progress reporting needed
  • Safe for tests and quiet build modes

Relationships:

  • Implements: ProgressReporter protocol
  • Used by: BuildOrchestrator as default reporter
  • Used in: Tests and quiet build modes

Methods

add_phase 3
def add_phase(self, phase_id: str, label: str, total: int | None = None) -> None
Parameters
Name Type Description
phase_id
label
total Default:None
start_phase 1
def start_phase(self, phase_id: str) -> None
Parameters
Name Type Description
phase_id
update_phase 3
def update_phase(self, phase_id: str, current: int | None = None, current_item: str | None = None) -> None
Parameters
Name Type Description
phase_id
current Default:None
current_item Default:None
complete_phase 2
def complete_phase(self, phase_id: str, elapsed_ms: float | None = None) -> None
Parameters
Name Type Description
phase_id
elapsed_ms Default:None
log 1
def log(self, message: str) -> None
Parameters
Name Type Description
message
LiveProgressReporterAdapter 7
Adapter to bridge LiveProgressManager to ProgressReporter protocol. Provides adapter pattern imple…

Adapter to bridge LiveProgressManager to ProgressReporter protocol.

Provides adapter pattern implementation that bridges LiveProgressManager to the ProgressReporter protocol. Delegates phase methods directly and prints simple lines for log() messages.

Creation: Direct instantiation: LiveProgressReporterAdapter(live_progress_manager)

  • Created by BuildOrchestrator when using LiveProgressManager
  • Requires LiveProgressManager instance

Relationships:

  • Implements: ProgressReporter protocol
  • Uses: LiveProgressManager for actual progress reporting
  • Used by: BuildOrchestrator for progress reporting

Attributes

Name Type Description
_pm

LiveProgressManager instance being adapted

Methods

add_phase 3
def add_phase(self, phase_id: str, label: str, total: int | None = None) -> None
Parameters
Name Type Description
phase_id
label
total Default:None
start_phase 1
def start_phase(self, phase_id: str) -> None
Parameters
Name Type Description
phase_id
update_phase 3
def update_phase(self, phase_id: str, current: int | None = None, current_item: str | None = None) -> None
Parameters
Name Type Description
phase_id
current Default:None
current_item Default:None
complete_phase 2
def complete_phase(self, phase_id: str, elapsed_ms: float | None = None) -> None
Parameters
Name Type Description
phase_id
elapsed_ms Default:None
log 1
def log(self, message: str) -> None
Parameters
Name Type Description
message
Internal Methods 1
__init__ 1
def __init__(self, live_progress_manager: Any)
Parameters
Name Type Description
live_progress_manager