exlab_wizard.api.routers.staging#

/staging router. Backend Spec §13.7, §13.8.

Four endpoints back the orchestrator’s staging panel:

  • GET /staging – enumerate every staged run with its lifecycle state, file count, byte total, and elapsed time since last activity.

  • POST /staging/{run_path}/force-sync – enqueue an immediate NAS sync for a specific run (used when the operator wants to skip the watcher’s polling latency).

  • POST /staging/{run_path}/clear – delete the local staging copy of a sync-verified run (the manual-mode action from §13.7).

  • POST /staging/clear-verified – bulk-clear every sync-verified staged run (Redesign §4.6 footer action).

All four return 503 with {"code": "internal_error"} when no Config is wired on the app (Redesign §3.1 made the orchestrator pipeline unconditional, so the legacy orchestrator.enabled toggle is gone).

Functions

build_staging_router()

Construct the /staging router.

Classes

ClearResponse(**data)

POST /staging/{run_path}/clear response.

ClearVerifiedResponse(**data)

POST /staging/clear-verified response (Redesign §4.6).

ForceSyncResponse(**data)

POST /staging/{run_path}/force-sync response.

KeepLocalRequest(**data)

POST /staging/{run_path}/keep-local request body.

KeepLocalResponse(**data)

POST /staging/{run_path}/keep-local response.

StagedRunRow(**data)

One staging-panel row.

StagingListResponse(**data)

GET /staging response.

class exlab_wizard.api.routers.staging.ClearResponse(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/clear response.

Parameters:

data (Any)

bytes_freed: int#
files_freed: int#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

run_path: str#
class exlab_wizard.api.routers.staging.ClearVerifiedResponse(**data)[source]#

Bases: BaseModel

POST /staging/clear-verified response (Redesign §4.6).

Parameters:

data (Any)

cleared_paths: list[str]#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class exlab_wizard.api.routers.staging.ForceSyncResponse(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/force-sync response.

Parameters:

data (Any)

job_id: str | None#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

run_path: str#
state: str#
class exlab_wizard.api.routers.staging.KeepLocalRequest(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/keep-local request body.

Operator-free per-file NAS sync design (2026-05-21): the operator toggles a file’s keep_local flag from the file-list context menu. relative_path is the run-relative POSIX path of the file within the run directory; keep_local is the desired flag value.

Parameters:

data (Any)

keep_local: bool#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

relative_path: str#
class exlab_wizard.api.routers.staging.KeepLocalResponse(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/keep-local response.

Parameters:

data (Any)

keep_local: bool#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

relative_path: str#
run_path: str#
class exlab_wizard.api.routers.staging.StagedRunRow(**data)[source]#

Bases: BaseModel

One staging-panel row. Backend Spec §13.8.

Parameters:

data (Any)

byte_total: int#
current_state: str#
elapsed_seconds_since_last_activity: int#
equipment_id: str#
file_count: int#
last_activity_at: str#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: str#
project_name: str#
run_kind: str#
class exlab_wizard.api.routers.staging.StagingListResponse(**data)[source]#

Bases: BaseModel

GET /staging response.

Parameters:

data (Any)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

runs: list[StagedRunRow]#
exlab_wizard.api.routers.staging.build_staging_router()[source]#

Construct the /staging router. Backend Spec §13.7, §13.8.

Return type:

APIRouter