Skip to content

Commit 01d3553

Browse files
authored
Merge pull request #134 from zestones/133-m95-full-frontend-polish
feat: update demo build spec for improved clarity and accuracy in onb…
2 parents 883634b + 9834c2a commit 01d3553

7 files changed

Lines changed: 73 additions & 209 deletions

File tree

backend/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ async def health() -> dict[str, str]:
137137
# to ``/mcp/<secret>``.
138138
from modules.sandbox.app import sandbox_app
139139

140-
app.mount(
141-
f"/sandbox/{settings.aria_mcp_path_secret}", sandbox_app, name="sandbox-secret"
142-
)
140+
app.mount(f"/sandbox/{settings.aria_mcp_path_secret}", sandbox_app, name="sandbox-secret")
143141

144142
return app
145143

backend/modules/debug/router.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ async def replay_investigator(
5151
work_order_id,
5252
)
5353
if wo is None:
54-
raise HTTPException(
55-
status_code=404, detail=f"work_order {work_order_id} not found"
56-
)
54+
raise HTTPException(status_code=404, detail=f"work_order {work_order_id} not found")
5755

5856
await conn.execute(
5957
"UPDATE work_order SET status = 'detected' WHERE id = $1",

backend/tests/unit/agents/investigator/test_prompts.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def test_sandbox_section_contains_at_least_two_worked_examples() -> None:
6363
"""
6464
fence_count = SANDBOX_DIAGNOSTICS_SECTION.count("PY")
6565
assert fence_count >= 4, (
66-
f"expected at least 2 Python heredoc examples (>=4 'PY' fences), "
67-
f"found {fence_count}"
66+
f"expected at least 2 Python heredoc examples (>=4 'PY' fences), " f"found {fence_count}"
6867
)
6968

7069

@@ -76,9 +75,9 @@ def test_sandbox_section_references_fft_and_trend_techniques() -> None:
7675
lower = SANDBOX_DIAGNOSTICS_SECTION.lower()
7776
assert "fft" in lower, "FFT example is missing"
7877
# polyfit / linear regression wording — either form is acceptable.
79-
assert any(term in lower for term in ("polyfit", "regression", "slope")), (
80-
"linear-trend / regression example is missing"
81-
)
78+
assert any(
79+
term in lower for term in ("polyfit", "regression", "slope")
80+
), "linear-trend / regression example is missing"
8281

8382

8483
# ---------------------------------------------------------------------------
@@ -91,9 +90,9 @@ def test_sandbox_section_mandates_sandbox_colon_prefix() -> None:
9190
so the numerical evidence lands in the work-order text itself.
9291
Dropping this rule makes the capability indistinguishable from
9392
Messages API token arithmetic in the RCA surface."""
94-
assert "Sandbox:" in SANDBOX_DIAGNOSTICS_SECTION, (
95-
"the Sandbox: prefix rule for submit_rca.root_cause is missing"
96-
)
93+
assert (
94+
"Sandbox:" in SANDBOX_DIAGNOSTICS_SECTION
95+
), "the Sandbox: prefix rule for submit_rca.root_cause is missing"
9796

9897

9998
def test_sandbox_section_has_failure_mode_keyed_rules() -> None:
@@ -109,28 +108,28 @@ def test_sandbox_section_has_failure_mode_keyed_rules() -> None:
109108
def test_sandbox_section_mandates_render_sandbox_execution_call() -> None:
110109
"""The visible-proof card must be called after bash + before submit_rca.
111110
Without this line the artifact is orphaned."""
112-
assert "render_sandbox_execution" in SANDBOX_DIAGNOSTICS_SECTION, (
113-
"render_sandbox_execution mandate is missing from the prompt"
114-
)
111+
assert (
112+
"render_sandbox_execution" in SANDBOX_DIAGNOSTICS_SECTION
113+
), "render_sandbox_execution mandate is missing from the prompt"
115114

116115

117116
def test_sandbox_section_references_required_regression_metrics() -> None:
118117
"""Drift-class rule requires slope / r_squared / eta — all three must
119118
appear so the agent knows the expected Sandbox: line shape."""
120119
for metric in ("slope_per_hour", "r_squared", "eta_"):
121-
assert metric in SANDBOX_DIAGNOSTICS_SECTION, (
122-
f"drift-class metric {metric!r} is missing from the prompt"
123-
)
120+
assert (
121+
metric in SANDBOX_DIAGNOSTICS_SECTION
122+
), f"drift-class metric {metric!r} is missing from the prompt"
124123

125124

126125
def test_sandbox_section_references_correlation_metrics() -> None:
127126
"""Coupling-class rule requires rho / n so the agent's output is
128127
parseable in the Sandbox: prefix."""
129128
lower = SANDBOX_DIAGNOSTICS_SECTION.lower()
130129
assert "rho" in lower, "coupling-class rho metric is missing"
131-
assert any(token in lower for token in ("n_samples", "n=")), (
132-
"coupling-class sample-count metric is missing"
133-
)
130+
assert any(
131+
token in lower for token in ("n_samples", "n=")
132+
), "coupling-class sample-count metric is missing"
134133

135134

136135
# ---------------------------------------------------------------------------

backend/tests/unit/agents/test_sentinel.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,7 @@ async def test_forecast_tick_skips_flat_series(patch_forecast) -> None:
736736
from datetime import timedelta
737737

738738
now = datetime.now(timezone.utc)
739-
flat = [
740-
{"time": now - timedelta(minutes=i), "raw_value": 10.0}
741-
for i in range(60, 0, -1)
742-
]
739+
flat = [{"time": now - timedelta(minutes=i), "raw_value": 10.0} for i in range(60, 0, -1)]
743740
signals = [
744741
{
745742
"signal_def_id": 10,

backend/tests/unit/agents/test_ui_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def test_all_llm_render_tools_are_anthropic_format():
4242
"""Every tool in ALL_LLM_RENDER_TOOLS is a valid Anthropic tool descriptor."""
4343
# 7 original LLM render tools (render_correlation_matrix dropped per audit
4444
# §2) + render_sandbox_execution (M5.7 / #105) = 8.
45-
assert len(ALL_LLM_RENDER_TOOLS) == 8, (
46-
"Expected 8 LLM render tools: 7 original + render_sandbox_execution (M5.7 / #105)"
47-
)
45+
assert (
46+
len(ALL_LLM_RENDER_TOOLS) == 8
47+
), "Expected 8 LLM render tools: 7 original + render_sandbox_execution (M5.7 / #105)"
4848
for tool in ALL_LLM_RENDER_TOOLS:
4949
_assert_anthropic_format(tool)
5050

backend/tests/unit/modules/sandbox/test_csv.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ async def _collect_body(response: Any) -> bytes:
8989
@pytest.mark.asyncio
9090
async def test_happy_path_returns_csv_ordered_ascending() -> None:
9191
t0 = datetime(2026, 4, 24, 12, 0, 0, tzinfo=timezone.utc)
92-
rows = [
93-
_sample_row(t0 + timedelta(seconds=30 * i), 2.2 + 0.01 * i) for i in range(5)
94-
]
92+
rows = [_sample_row(t0 + timedelta(seconds=30 * i), 2.2 + 0.01 * i) for i in range(5)]
9593
conn = _FakeConn(definition=_sample_definition(), rows=rows)
9694

9795
response = await sandbox_mod.signal_csv(

0 commit comments

Comments
 (0)