exlab_wizard.api.routers.problems#

/problems router. Backend Spec §4.6.1, §11.8.

Endpoints:

  • GET /problems – query findings with optional scope/severity/class.

  • POST /problems/{run_path}/override – append an override entry.

  • POST /problems/{run_path}/override/revoke – append a tombstone.

  • POST /problems/refresh – re-run Validator.audit("all").

  • WS /problems/events – subscribe to the audit pub-sub channel.

The router dispatches to the bound Validator, the CreationWriter for override mutations, and the audit_channel pub-sub object that the lifespan handler attaches.

Functions

build_problems_router()

Construct the /problems router.

Classes

FindingResponse(**data)

One finding row in the §11.8 schema.

OverrideRequest(**data)

POST /problems/{run_path}/override body.

OverrideResponse(**data)

Override append response.

ProblemsResponse(**data)

GET /problems response.

RefreshResponse(**data)

POST /problems/refresh response.

RevokeRequest(**data)

POST /problems/{run_path}/override/revoke body.

TombstoneResponse(**data)

class exlab_wizard.api.routers.problems.FindingResponse(**data)[source]#

Bases: BaseModel

One finding row in the §11.8 schema.

Parameters:

data (Any)

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

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

offending_kind: str#
offending_path: str#
override_active: bool#
rule: str#
rule_detail: str#
run_path: str#
synced_under_prior_policy: bool#
tier: str#
class exlab_wizard.api.routers.problems.OverrideRequest(**data)[source]#

Bases: BaseModel

POST /problems/{run_path}/override body. Backend Spec §11.3.

Parameters:

data (Any)

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

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

operator: str#
problem_class: str#
reason: str#
class exlab_wizard.api.routers.problems.OverrideResponse(**data)[source]#

Bases: BaseModel

Override append response.

Parameters:

data (Any)

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

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

operator: str#
problem_class: str#
reason: str#
recorded_at: str#
revoked: bool#
class exlab_wizard.api.routers.problems.ProblemsResponse(**data)[source]#

Bases: BaseModel

GET /problems response.

Parameters:

data (Any)

audit_at: str#
findings: list[FindingResponse]#
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.problems.RefreshResponse(**data)[source]#

Bases: BaseModel

POST /problems/refresh response.

Parameters:

data (Any)

audit_at: str#
finding_count: int#
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.problems.RevokeRequest(**data)[source]#

Bases: BaseModel

POST /problems/{run_path}/override/revoke body. Backend Spec §11.3.

Parameters:

data (Any)

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

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

operator: str#
reason: str#
revokes: str#
exlab_wizard.api.routers.problems.build_problems_router()[source]#

Construct the /problems router.

Return type:

APIRouter