Signals
A signal is a deterministic finding with evidence. Every evaluation returns one entry per rule instance with status: "pass" or status: "fail". Only failures carry evidence.
A signal has:
| Field | Meaning |
|---|---|
id | Stable id for this finding. |
rule | R001–R008. |
severity | critical, high, medium or low. |
status | pass or fail. |
title | The rule title. |
summary | What was observed, including the numbers when relevant. |
fixHint | The repair the rule expects. |
evidence | Trace id, component id, source location, request id, artefact id or selector that proves the finding. |
Signals are not a score and not an LLM judgement. They are rules over the evidence the app has already collected.
Rules
| Rule | Title | Severity | What triggers a failure |
|---|---|---|---|
| R001 | Uncaught error | critical | An error.uncaught event. Evidence includes the trace, the component and its source location when known. |
| R002 | Console error | medium | An error.console event. Evidence points at the trace. |
| R003 | Failed request | high | A request with a failing status or a transport error, recorded in diagnostics. Evidence carries the request id. |
| R004 | Stuck loading | high | A failed request exists and a component is still loading or dataStatus: "loading". Evidence carries the component, source and request id. |
| R005 | Horizontal overflow | medium | The page scrolls horizontally at the probed viewport. The hub stores a screenshot when it detects overflow. |
| R006 | Interactive control without a name | medium | The accessibility probe finds an interactive control with no accessible name. |
| R007 | Low text contrast | low | A contrast sample is below 4.5:1. |
| R008 | Component without source mapping | low | A reported component has source: null. |
What each rule needs
| Rule | Source |
|---|---|
| R001, R002 | Runtime events. No probe needed. |
| R003, R004 | Snapshot diagnostics and component state. No probe needed. |
| R005, R006 | A viewport probe: veya_signals with viewport while the Electron host is available. |
| R007 | Contrast samples. The bundled Electron host does not collect them in v0.1, so R007 reports a pass unless a host supplies samples. |
| R008 | The component tree. No probe needed. |
A pass for R005 without a viewport means "no layout probe was captured", not "the layout is correct". Pass viewport when you care about responsive layout.
Run the rules
Through MCP:
{
"tool": "veya_signals",
"arguments": {
"viewport": { "width": 390, "height": 844 }
}
}Through the hub:
curl -s -X POST http://127.0.0.1:7317/v1/sessions/<sessionId>/signals \
-H 'content-type: application/json' \
-d '{"viewport":{"width":390,"height":844}}'The host resizes the window that owns the session (the agent window by default), waits two animation frames, probes scrollWidth and accessible names, captures a screenshot if the page overflows, and evaluates the rules. Pass a human sessionId to probe the human window. Without a viewport, the last probe for the session is reused if one exists.
veya_context reports the current failing signals without probing. It reuses the same last probe, if any; see The context brief. Use veya_signals with a viewport when you need a fresh layout and accessibility check.
The demo's planted defects
pnpm dev:demo serves a dashboard with deliberate problems. A useful first evaluation is:
{
"tool": "veya_signals",
"arguments": { "viewport": { "width": 390, "height": 844 } }
}Expected failures on a fresh session include:
| Defect | Signal |
|---|---|
/api/revenue returns 500 and the component stays in loading. | R002 console error, R003 failed request, R004 stuck loading. |
| The dashboard overflows at 390px. | R005 horizontal overflow, with a screenshot artefact. |
| The project list has an icon-only button with no accessible name. | R006 unlabelled control. |
The revenue failure is logged with console.error. | R002 console error. |
The slow /api/stats request is recorded in diagnostics as a slow request, but it is not a signal in v0.1. The empty project list without guidance is a product gap, not a deterministic rule failure.
Read a finding
A failure points at the evidence:
{
"rule": "R004",
"severity": "high",
"status": "fail",
"summary": "RevenueChart stayed in a loading state after a request failed",
"fixHint": "Give the request an error branch so the component leaves its loading state.",
"evidence": {
"componentId": "dashboard.revenue",
"source": { "file": "src/App.tsx", "line": 38, "column": 5 },
"requestId": "req_01JABCDEF"
}
}Use veya_trace with the trace from the related event, or veya_events filtered by component or request, to read the cause. Then make the change and evaluate again.
Fix and verify
- Inspect the evidence and the source location.
- Change the component or request handling.
- Reload the product. This creates a new session.
- Evaluate the rules again.
- Use
veya_performto verify the corrected behaviour, not just a successful click.
{
"tool": "veya_perform",
"arguments": {
"steps": [
{ "kind": "click", "target": "project.create" },
{
"kind": "expect",
"expect": {
"events": ["interaction.started", "state.changed"],
"state": { "dashboard.dialogOpen": true }
}
}
]
}
}Limits
- Rules are deterministic. They do not judge aesthetics or UX quality.
- R005 and R006 need the Electron host for a fresh probe.
- R007 has no contrast samples from the bundled host in v0.1.
- A pass means the rule found nothing in the evidence it had. It does not prove the absence of a defect.