Uat Surfaces¶
Cluster: Uncategorised | Type: component | MCP Tools: 6
Overview¶
Public API¶
AccessibilityCheck(BaseModel)¶
| Field | Type | Default |
|---|---|---|
surface | str | required |
labels_present | bool | True |
no_color_only_meaning | bool | True |
keyboard_focusable_actions | bool | True |
modal_has_label | bool | True |
violations | list[str] | Field(default_factory=list) |
UatSurfacesDecisionError(ValueError)¶
The LLM did not produce a usable, validated risk-tier decision.
PokaYokeContext¶
Inputs to a grounded poka_yoke risk-gate decision.
| Field | Type | Default |
|---|---|---|
risk | Any | 'low' |
operation | str | '' |
context | str | '' |
workspace_name | str | '' |
typed_confirmation | str | '' |
idempotency_key | str | '' |
production_workspace | bool | False |
RiskTierDecision¶
Validated risk-tier verdict for a poka_yoke gate decision.
| Field | Type | Default |
|---|---|---|
risk | str | required |
declared_risk | str | required |
requires_review | bool | False |
degraded | bool | False |
llm_used | bool | False |
rationale | str | '' |
raw_response | str | '' |
GroundedPokaYokeDecision¶
Wrapper carrying the authoritative
PokaYokeDecision+ grounded fields.
| Field | Type | Default |
|---|---|---|
decision | PokaYokeDecision | required |
declared_risk | str | required |
final_risk | str | required |
requires_review | bool | False |
degraded | bool | False |
llm_used | bool | False |
rationale | str | '' |
raw_response | str | '' |
Methods:
allowed() -> bool¶
risk() -> str¶
required_confirmation() -> str¶
idempotency_required() -> bool¶
agentic_evidence() -> dict[str, Any]¶
to_dict() -> dict[str, Any]¶
UatSurfacesRuntime(Protocol)¶
Methods:
decide(ctx: PokaYokeContext) -> RiskTierDecision¶
LLMUatSurfacesRuntime¶
Provider-neutral risk-tier classification runtime backed by G6's LLM caller.
Constructor:
| Parameter | Type | Default |
|---|---|---|
llm | LLMCaller \| None | None |
Methods:
decide(ctx: PokaYokeContext) -> RiskTierDecision¶
UatSurfacesPlanner¶
Runtime-first facade with deterministic fallback + one-way risk-tier clamp.
Constructor:
| Parameter | Type | Default |
|---|---|---|
runtime | UatSurfacesRuntime \| None | None |
Methods:
decide(ctx: PokaYokeContext) -> RiskTierDecision¶
ContextUploadSummary(BaseModel)¶
| Field | Type | Default |
|---|---|---|
file_path | str | required |
uploaded | bool | required |
summarized_tokens | int | required |
embedded_into_project_memory | bool | required |
cleared_after_run | bool | required |
persisted | bool | required |
storage_notice | str | required |
clear_action_label | str | 'Clear uploaded context' |
InitConfig(BaseModel)¶
| Field | Type | Default |
|---|---|---|
backend | BackendChoice | required |
cost_warning | str | required |
quality_warning | str | required |
recommended | bool | False |
writes | list[str] | required |
sentinel_path | str | '~/.g6/.onboarding_done' |
first_task | str | 'Summarise this README' |
explicit_opt_in_required | bool | True |
UatSurfacesPatternReview¶
Structured one-way (escalate-only) review for a risk-gate verdict.
| Field | Type | Default |
|---|---|---|
tightened | bool | required |
reason | str | required |
risk | str | required |
declared_risk | str | required |
requires_review | bool | False |
requires_human_review | bool | False |
warnings | tuple[str, ...] | () |
reflection | str | '' |
Methods:
to_metadata() -> dict[str, Any]¶
UatSurfacesPatternRuntime¶
Stateless executable mechanisms for uat_surfaces' applied patterns.
Methods:
tighten(risk: Any, declared_risk: Any = '', requires_review: bool = False, degraded: bool = False, production_workspace: bool = False) -> UatSurfacesPatternReview¶
One-way risk-gate guard (hook-based-safety-guard-rails).
PokaYokeDecision(BaseModel)¶
| Field | Type | Default |
|---|---|---|
allowed | bool | required |
risk | OperationRisk | required |
reason | str | '' |
required_confirmation | str | '' |
idempotency_required | bool | False |
SessionVisibility(BaseModel)¶
| Field | Type | Default |
|---|---|---|
project | str | required |
workspace | str | required |
last_runs | list[str] | Field(default_factory=list) |
persistent_data | list[str] | Field(default_factory=list) |
clear_project_memory_action | str | 'clear_project_memory' |
multi_copy_warning | bool | False |
UatSurfacesSkill¶
| Field | Type | Default |
|---|---|---|
name | str | required |
pattern_slug | str | required |
description | str | required |
executable | bool | required |
mechanism | str | required |
capabilities | tuple[str, ...] | required |
triggers | tuple[str, ...] | required |
risk_notes | tuple[str, ...] | required |
Methods:
compact() -> dict[str, Any]¶
UatSurfacesSkillCatalog¶
Maps each applied pattern slug to a poka_yoke risk-gate skill record.
Methods:
list_skills() -> list[UatSurfacesSkill]¶
executable_skills() -> list[UatSurfacesSkill]¶
get(slug: str) -> UatSurfacesSkill | None¶
SurfaceEnvelope(BaseModel)¶
| Field | Type | Default |
|---|---|---|
surface | Literal['gui', 'tui', 'cli', 'rest', 'mcp'] | required |
task_id | str | required |
correlation_id | str | required |
error_code | str | '' |
completion_state | CompletionState | 'draft' |
audit_event_type | str | 'surface_task' |
warnings | list[str] | Field(default_factory=list) |
reliability_label | str | 'draft' |
warning_card | dict | Field(default_factory=dict) |
idempotency_key | str | '' |
Functions¶
static_accessibility_check(surface: str, labels: list[str], actions: list[str], modal_label: str = '') -> AccessibilityCheck¶
summarize_uat_surfaces_agentic_evidence(decisions: list[dict[str, Any]]) -> dict[str, Any]¶
Summarise runtime-vs-fallback risk-gate decisions with path redaction.
agentic_planner_enabled(default_enabled: bool = True) -> bool¶
Decide whether the agentic poka_yoke risk-classifier should be used.
validate_risk_tier(tier: Any) -> str¶
Validate a candidate risk tier (fail closed on anything non-canonical).
validate_risk_decision(decision: RiskTierDecision) -> None¶
Assert a FINAL risk verdict is canonical and never loosened.
deterministic_poka_yoke_decision(ctx: PokaYokeContext) -> RiskTierDecision¶
Demoted-real risk verdict (the zero-LLM declared-risk gate).
apply_risk_floor(declared: Any, candidate: Any) -> RiskTierDecision¶
One-way risk-tier safety clamp (stricter-of, ESCALATE only).
poka_yoke_pattern_guard(decision: RiskTierDecision, production_workspace: bool = False) -> tuple[RiskTierDecision, Any]¶
Apply the always-on one-way (escalate-only) structural guard to a decision.
grounded_assess_operation(ctx: PokaYokeContext, planner: 'UatSurfacesPlanner | None' = None) -> GroundedPokaYokeDecision¶
The ONE shared grounded chokepoint for EVERY poka_yoke risk-gate decision.
summarize_context_upload(path: str | Path, persist: bool = False, clear_after_run: bool = True) -> ContextUploadSummary¶
build_init_config(choice: BackendChoice = 'claude_codex') -> InitConfig¶
applied_agentic_patterns() -> list[dict[str, Any]]¶
Return compact metadata for uat_surfaces-applied vendored patterns.
assess_operation(risk: OperationRisk, workspace_name: str = '', typed_confirmation: str = '', idempotency_key: str = '') -> PokaYokeDecision¶
recovery_suggestions(error_code: str, message: str = '') -> dict¶
redact_secrets(text: str) -> str¶
build_session_visibility(workspace: str | Path, project: str = '', last_runs: list[str] | None = None, persistent_data: list[str] | None = None, process_count: int = 1) -> SessionVisibility¶
get_skill_catalog() -> UatSurfacesSkillCatalog¶
build_surface_envelope(surface: str, task_id: str, correlation_id: str, error_code: str = '', completion_state: CompletionState = 'draft', warnings: list[str] | None = None, idempotency_key: str = '') -> SurfaceEnvelope¶
workspace_indicator(workspace: str | Path, production: bool = False, sandbox: bool = True, process_count: int = 1) -> dict¶
production_confirmation_valid(workspace: str | Path, typed: str) -> bool¶
MCP Tools¶
| Operation | Source |
|---|---|
ops | uat_surfaces_mcp |
help | uat_surfaces_mcp |
assess_operation | uat_surfaces_mcp |
workspace_indicator | uat_surfaces_mcp |
redact_secrets | uat_surfaces_mcp |
list_patterns | uat_surfaces_mcp |