Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/sdlc.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Every user and system flow, with the functions involved, is in [process-flows.md

## 3. Implementation

- **Stack:** Python 3.11 and 3.12. Runtime pins in [requirements.txt](../target_app/requirements.txt): fastapi 0.104.1, uvicorn 0.24.0.post1, jinja2 3.1.2, psutil 5.9.6, numpy 1.26.4, scikit-learn 1.3.2, langchain-core 0.1.16, langchain-google-genai 0.0.6, prometheus-client 0.26.0.
- **Stack:** Python 3.11 and 3.12. Runtime pins in [requirements.txt](../target_app/requirements.txt): fastapi 0.162.2, uvicorn 0.54.0, jinja2 3.1.6, psutil 7.2.2, numpy 2.4.6, scikit-learn 1.9.1, langchain-core 1.7.6, langchain-google-genai 4.4.3, python-dotenv 1.2.4, python-multipart 0.0.33, prometheus-client 0.26.0. On 2026-11-09 these had 0 known advisories on OSV.dev.
- **Dev tools:** [requirements-dev.txt](../requirements-dev.txt) pins pytest 9.1.1, pytest-cov 7.1.0, httpx 0.27.2, ruff 0.6.9 and pyyaml 6.0.3.
- **Layout:** `target_app/` holds the app, `tests/` the tests, `monitoring/` the Prometheus and Grafana stack, `docs/` the documents. `run_all.py` is the local entry point. `reports/` holds generated sample incident reports.
- **Standards:** ruff checks and formats, configured in [pyproject.toml](../pyproject.toml) (line length 100, rules E, F, W, I, B, UP). CI enforces both.
Expand Down Expand Up @@ -95,5 +95,5 @@ flowchart LR
- **Single author, so no peer review.** Pull requests are self-merged. Next step: ask a reviewer to approve changes, or enable branch protection.
- **Some work went directly to `main`.** Next step: require pull requests on `main`.
- **No coverage threshold.** Next step: set `--cov-fail-under` in CI.
- **Old runtime pins.** FastAPI 0.104.1 and langchain-core 0.1.16 are old. Next step: add Dependabot and upgrade deliberately.
- **Pins age.** The runtime pins were upgraded on 2026-11-09 (0 OSV advisories) but are exact, so they will age again. Next step: add Dependabot.
- **Monitoring stack is local only.** Next step: say so in the README, or host it.
35 changes: 35 additions & 0 deletions docs/uat.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,38 @@ Mark each task pass or fail.
## Sign-off

Tested by: ____________________ Date: ____________ Build or commit: ____________ Result (pass if at least 4 of 5 testers pass T1 to T3): ____________

## Automated acceptance check (2026-11-09)

> Automated stand-in, not a real-user test: a scripted browser ran each task on the live demo. It shows each task *can* be completed, not that people understand the page. The real-user results table above is still to be filled.

Playwright with Chrome against https://deepbell.onrender.com, at 390x844 and 1280x800. The guided demo was run once and one fault (a 60 MB memory leak, then Release memory) was injected once, both at desktop size; the phone run reused the resulting incidents and only checked that the demo and fault controls were visible and enabled.

| Task | phone 390px | desktop 1280px | notes |
|---|---|---|---|
| T1 Get started | n/a (needs a person); page shown in 4.0 s, heading and intro text present | n/a (needs a person); page shown in 4.1 s, heading and intro text present | Server was already awake, so the 60 s cold start was not measured. Whether a visitor can say what it is for needs a person. |
| T2 See it work | not re-run (shared demo); "Run the demo again" button visible and enabled | pass: clicked "Run the guided demo", incidents appeared within seconds (4 incidents after the full demo) | Demo run once only, to protect the shared instance. |
| T3 Read the result | pass: incident #4 opens; "Time to detect 3 s" and cause shown | pass: same | Correctness of what a person reads from it needs a person. |
| T4 Judge the report | pass: badge "Built-in template"; cause "Heuristic, low confidence" | pass: same | Whether the visitor gets it right needs a person. Report notes no Gemini key is set, so a template report is the only source seen. |
| T5 Break something yourself | not re-run; "Inject 60 MB leak" and "Release memory" visible and enabled | pass: injected the memory leak, then Release memory; "Released ... MB" confirmed | No cooldown or cap message was hit (the demo's cooldown had ended). Reading such a message correctly needs a person. |

Screenshots (one per task per size) are kept outside the repo.

### Accessibility (axe-core 4.10.2)

Views scanned at both sizes: overview, incidents (list with an incident and its report open), alerts, Chaos Lab. Reports live inside the Incidents view, so there is no separate reports page. Injection worked; no CSP or SRI block.

Totals across distinct view/size scans: critical 0, serious 14 violation instances across 4 rules, moderate 1 (phone Chaos Lab, 3 nodes), minor 0.

- `scrollable-region-focusable` (serious, on every view): a scrolling area cannot be reached by keyboard.
- `nested-interactive` (serious, overview, 3 nodes at both sizes): a control sits inside another control, which confuses screen readers.
- `color-contrast` (serious, Chaos Lab, 2 nodes at both sizes): text too faint against its background.
- `skip-link` (moderate, phone Chaos Lab, 3 nodes): a skip link's target is missing or not focusable at that view.

Fixed the same day: a shared event log and the data tables are now keyboard-focusable with a visible focus ring; the three overview KPI bar charts are role=group instead of role=img, so their links no longer nest inside an image; the faint Chaos Lab text (disabled crash card, warn and orange labels in the light theme) is raised to at least 4.5:1; the nav hash targets now exist. A local re-scan with axe 4.10.2 of overview, incidents, alerts and Chaos Lab at 390 and 1280 px, in both themes, reports 0 violations. The nested-interactive fix was not re-scanned with incident data, as that needs injected faults.

### Bugs found

None blocking. Observations: the phone tab bar clips "Live Telemetry" (scrolls sideways); the detail of CPU spike #4 reads "No injected fault on record" even though the demo started it, so the cause is shown as "Heuristic, low confidence"; CPU spike #1 and Memory leak #2 opened at the same second (15:39:29), which may read as a duplicate.

Dependency check the same day: target_app/requirements.txt had 48 known advisories on OSV.dev; upgraded to fastapi 0.162.2, uvicorn 0.54.0, jinja2 3.1.6, psutil 7.2.2, numpy 2.4.6, scikit-learn 1.9.1, langchain-core 1.7.6, langchain-google-genai 4.4.3, python-dotenv 1.2.4, python-multipart 0.0.33; now 0.
2 changes: 1 addition & 1 deletion target_app/deepbell/routes/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def static_version() -> str:
async def read_dashboard(request: Request):
"""Serve the dashboard."""
return templates.TemplateResponse(
request,
"index.html",
{
"request": request,
"report": reports.latest_report(),
"api_key_configured": bool(llm.get_api_key()),
"public_demo": config.PUBLIC_DEMO,
Expand Down
20 changes: 10 additions & 10 deletions target_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
fastapi==0.104.1
uvicorn==0.24.0.post1
jinja2==3.1.2
psutil==5.9.6
numpy==1.26.4
scikit-learn==1.3.2
langchain-core==0.1.16
langchain-google-genai==0.0.6
python-dotenv==1.0.0
python-multipart==0.0.6
fastapi==0.162.2
uvicorn==0.54.0
jinja2==3.1.6
psutil==7.2.2
numpy==2.4.6
scikit-learn==1.9.1
langchain-core==1.7.6
langchain-google-genai==4.4.3
python-dotenv==1.2.4
python-multipart==0.0.33
prometheus-client==0.26.0
1 change: 1 addition & 0 deletions target_app/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ function renderCause(cause) {
setHTML($('cause-body'), `
<p class="cause-summary">${esc(cause.summary)}</p>
<p class="cause-note">${esc(cause.confidence_reason)}</p>
${cause.confidence === 'low' ? '<p class="cause-note">Low confidence means no fault was recorded for this incident, so the telemetry shows what moved and when, but not why.</p>' : ''}
${cause.evidence.length ? `<h4 class="cause-label">Evidence</h4>${list(cause.evidence)}` : ''}
${cause.not_found.length ? `<h4 class="cause-label">Checked, not found</h4>${list(cause.not_found)}` : ''}
<p class="cause-note cause-disclaimer">${esc(cause.disclaimer)}</p>`);
Expand Down
10 changes: 6 additions & 4 deletions target_app/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@

--ok-text: #047857;
--ok-soft: rgba(16, 185, 129, 0.11);
--warn-text: #b45309;
--warn-text: #9a4a08;
--warn-soft: rgba(245, 158, 11, 0.13);
--bad-text: #b91c1c;
--bad-soft: rgba(239, 68, 68, 0.09);
--info-text: #0369a1;
--info-soft: rgba(56, 189, 248, 0.12);
--orange: #c2410c;
--orange: #b53a0b;
--orange-soft: rgba(234, 88, 12, 0.09);
--yellow: #a16207;
--yellow: #8c5606;
--yellow-soft: rgba(202, 138, 4, 0.1);
--violet: #7e22ce;
--violet-soft: rgba(147, 51, 234, 0.09);
Expand Down Expand Up @@ -2521,6 +2521,8 @@ input {
border-color: var(--accent-line);
}

.log:focus-visible,
.table-wrap:focus-visible,
.incident-row:focus-visible {
outline: none;
box-shadow: var(--ring);
Expand Down Expand Up @@ -2958,7 +2960,7 @@ abbr[title] {
}

.chaos-card.is-disabled {
opacity: 0.66;
opacity: 0.88;
}

.chaos-card.is-disabled:hover {
Expand Down
32 changes: 16 additions & 16 deletions target_app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h1 id="view-title" tabindex="-1">Overview</h1>
</header>

<!-- Overview -->
<section class="view" id="view-overview" aria-labelledby="view-title">
<section class="view" id="view-overview" aria-labelledby="view-title"><span id="overview"></span>
<div class="status-banner" id="status-banner" data-tone="neutral">
<span class="banner-icon" aria-hidden="true"><span class="pulse-dot"></span></span>
<div class="banner-copy">
Expand Down Expand Up @@ -244,19 +244,19 @@ <h2 id="demo-title">Guided demo</h2>
<span class="kpi-label"><svg class="icon" aria-hidden="true"><use href="#i-incident"/></svg>Open incidents</span>
<span class="kpi-value" id="kpi-open">--</span>
<span class="kpi-note" id="kpi-open-note">--</span>
<svg class="kpi-bars" id="kpi-open-bars" viewBox="0 0 120 28" role="img" aria-label="Loading incidents"></svg>
<svg class="kpi-bars" id="kpi-open-bars" viewBox="0 0 120 28" role="group" aria-label="Loading incidents"></svg>
</div>
<div class="kpi">
<span class="kpi-label"><svg class="icon" aria-hidden="true"><use href="#i-target"/></svg>Time to detect</span>
<span class="kpi-value" id="kpi-ttd">--</span>
<span class="kpi-note" id="kpi-ttd-note">median, fault to incident</span>
<svg class="kpi-bars" id="kpi-ttd-bars" viewBox="0 0 120 28" role="img" aria-label="Loading incidents"></svg>
<svg class="kpi-bars" id="kpi-ttd-bars" viewBox="0 0 120 28" role="group" aria-label="Loading incidents"></svg>
</div>
<div class="kpi">
<span class="kpi-label"><svg class="icon" aria-hidden="true"><use href="#i-restore"/></svg>Time to recover</span>
<span class="kpi-value" id="kpi-ttr">--</span>
<span class="kpi-note" id="kpi-ttr-note">median, incident to resolved</span>
<svg class="kpi-bars" id="kpi-ttr-bars" viewBox="0 0 120 28" role="img" aria-label="Loading incidents"></svg>
<svg class="kpi-bars" id="kpi-ttr-bars" viewBox="0 0 120 28" role="group" aria-label="Loading incidents"></svg>
</div>
</div>

Expand Down Expand Up @@ -357,13 +357,13 @@ <h2 id="watchdog-title">Telemetry watchdog</h2>
</div>
<div class="terminal">
<div class="terminal-head"><svg class="icon" aria-hidden="true"><use href="#i-terminal"/></svg><span>server_events</span><span class="terminal-meta">{% if public_demo %}shared by every visitor{% else %}this run{% endif %}</span></div>
<ol class="log" id="log-overview" aria-label="Server events, newest first"><li class="log-empty">Waiting for events…</li></ol>
<ol class="log" id="log-overview" tabindex="0" aria-label="Server events, newest first"><li class="log-empty">Waiting for events…</li></ol>
</div>
</section>
</section>

<!-- Incidents -->
<section class="view" id="view-incidents" aria-labelledby="view-title" hidden>
<section class="view" id="view-incidents" aria-labelledby="view-title" hidden><span id="incidents"></span>
<div class="view-intro">
<p class="view-lead">Every incident this server has opened, newest first. <strong>Time to detect</strong> runs from the fault (or the first anomalous sample) to the incident opening; <strong>time to recover</strong> from opening to resolution. Both are demo measurements from this server's own clock.</p>
<div class="toolbar">
Expand Down Expand Up @@ -437,7 +437,7 @@ <h3 class="report-title" id="report-title">Report</h3>
</section>

<!-- Alerts -->
<section class="view" id="view-alerts" aria-labelledby="view-title" hidden>
<section class="view" id="view-alerts" aria-labelledby="view-title" hidden><span id="alerts"></span>
<p class="view-lead">Alert rules watch one metric each. A rule is <strong>pending</strong> while its condition is true but has not lasted long enough, <strong>firing</strong> once it has lasted its full duration, and <strong>resolved</strong> when the condition clears. The rules are read at startup from <code>target_app/alert_rules.json</code>: edit that file and restart to change them.</p>
<div class="grid">
<section class="panel col-7" aria-labelledby="rules-title">
Expand All @@ -462,7 +462,7 @@ <h2 id="alert-history-title">Recent changes</h2>
</section>

<!-- Live Telemetry -->
<section class="view" id="view-telemetry" aria-labelledby="view-title" hidden>
<section class="view" id="view-telemetry" aria-labelledby="view-title" hidden><span id="telemetry"></span>
<section class="panel" aria-labelledby="tl-title">
<div class="panel-header">
<div>
Expand Down Expand Up @@ -523,7 +523,7 @@ <h2 id="space-title">What the detector sees</h2>
<h2 id="samples-title">Latest samples</h2>
<span class="live-tag"><span class="live-dot" aria-hidden="true"></span><span class="live-text">newest first</span></span>
</div>
<div class="table-wrap">
<div class="table-wrap" tabindex="0" role="region" aria-label="Recent samples">
<table class="table">
<thead><tr><th scope="col">Time</th><th scope="col" class="num">CPU %</th><th scope="col" class="num">Memory MB</th><th scope="col" class="num hide-sm">Memory vs baseline</th><th scope="col">Watchdog</th></tr></thead>
<tbody id="samples-body"><tr><td colspan="5" class="table-empty">Loading samples…</td></tr></tbody>
Expand All @@ -533,7 +533,7 @@ <h2 id="samples-title">Latest samples</h2>
</section>

<!-- Chaos Lab -->
<section class="view" id="view-chaos" aria-labelledby="view-title" hidden>
<section class="view" id="view-chaos" aria-labelledby="view-title" hidden><span id="chaos"></span>
<p class="view-lead">Cause a real failure in this server and watch the pipeline react in Live results.{% if public_demo %} Faults are shared by everyone on this demo, capped, and each has a {{ config.cooldownSec }} s cooldown.{% endif %}</p>
<div class="grid">
<section class="panel faults-panel col-7" aria-labelledby="faults-title">
Expand Down Expand Up @@ -636,7 +636,7 @@ <h2 id="live-title">Live results</h2>
</div>
<div class="terminal">
<div class="terminal-head"><svg class="icon" aria-hidden="true"><use href="#i-terminal"/></svg><span>server_events</span><span class="terminal-meta">{% if public_demo %}shared{% else %}this run{% endif %}</span></div>
<ol class="log log-short" id="log-chaos" aria-label="Server events, newest first"><li class="log-empty">Waiting for events…</li></ol>
<ol class="log log-short" id="log-chaos" tabindex="0" aria-label="Server events, newest first"><li class="log-empty">Waiting for events…</li></ol>
</div>
<div class="report-teaser">
<div>
Expand All @@ -650,7 +650,7 @@ <h2 id="live-title">Live results</h2>
</section>

<!-- Time Machine -->
<section class="view" id="view-timemachine" aria-labelledby="view-title" hidden>
<section class="view" id="view-timemachine" aria-labelledby="view-title" hidden><span id="timemachine"></span>
<p class="view-lead">The app's own SQLite database holds sample transactions. Every {{ config.snapshotIntervalSec }} s it is copied to a snapshot if its contents changed, and the newest {{ config.snapshotsKeep }} are kept. Corrupt it in the Chaos Lab, then roll back here.</p>
<div class="db-alert db-alert-lg" data-db-alert hidden>
<svg class="icon" aria-hidden="true"><use href="#i-database"/></svg>
Expand All @@ -666,7 +666,7 @@ <h2 id="snap-title">Snapshots</h2>
</div>
</div>
<div class="snap-track" id="snap-track" aria-hidden="true"></div>
<div class="table-wrap">
<div class="table-wrap" tabindex="0" role="region" aria-label="Snapshots">
<table class="table">
<thead><tr><th scope="col">Taken</th><th scope="col" class="num"><abbr title="Transactions in the snapshot">Rows</abbr></th><th scope="col" class="num hide-sm">Size</th><th scope="col" class="num"><span class="sr-only">Action</span></th></tr></thead>
<tbody id="snap-body"><tr><td colspan="4" class="table-empty">Loading snapshots…</td></tr></tbody>
Expand All @@ -693,7 +693,7 @@ <h2 id="tx-title">Transactions</h2>
</div>
<p class="field-error" id="tx-error" aria-live="polite"></p>
</form>
<div class="table-wrap">
<div class="table-wrap" tabindex="0" role="region" aria-label="Recent transactions">
<table class="table">
<thead><tr><th scope="col">Time</th><th scope="col" class="num">Amount</th><th scope="col" class="hide-sm">ID</th></tr></thead>
<tbody id="tx-body"><tr><td colspan="3" class="table-empty">Loading transactions…</td></tr></tbody>
Expand All @@ -705,7 +705,7 @@ <h2 id="tx-title">Transactions</h2>
</section>

<!-- About -->
<section class="view" id="view-about" aria-labelledby="view-title" hidden>
<section class="view" id="view-about" aria-labelledby="view-title" hidden><span id="about"></span>
<div class="grid">
<section class="panel prose col-8" aria-labelledby="why-title">
<h2 id="why-title">Why it exists</h2>
Expand Down Expand Up @@ -785,7 +785,7 @@ <h2 id="limits-title">Limitations</h2>

{% if not public_demo %}
<!-- Settings (local runs only) -->
<section class="view" id="view-settings" aria-labelledby="view-title" hidden>
<section class="view" id="view-settings" aria-labelledby="view-title" hidden><span id="settings"></span>
<section class="panel narrow" aria-labelledby="key-title">
<div class="panel-header">
<div>
Expand Down
Loading