137 Commits

Author SHA1 Message Date
885196d933 refactor(deploy): remove per-app tunnel in favour of central cloudflared
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 20s
CI / Test (push) Successful in 57s
CI / Release (push) Has been skipped
Routing now handled by central cloudflared + NPM on public-network.
2026-02-03 23:43:29 +00:00
f4c34e4689 fix(deploy): rename cloudflared service to avoid DNS collision
All checks were successful
CI / Lint (push) Successful in 6s
CI / Type Check (push) Successful in 21s
CI / Test (push) Successful in 1m0s
CI / Release (push) Has been skipped
Multiple projects using the same service name on a shared Docker network
causes DNS resolution conflicts. Renamed to 'tunnel' for uniqueness.
2026-02-03 00:15:13 +00:00
aba2cabbbc fix(dashboard): stop server event loop on correct thread
All checks were successful
CI / Lint (push) Successful in 5s
CI / Type Check (push) Successful in 20s
CI / Test (push) Successful in 1m3s
CI / Release (push) Has been skipped
When idle shutdown triggered _stop_server(), it was creating a new event
loop and calling server.stop() on it, but the daemon thread was still
running loop.run_forever() on the original event loop. This left sockets
bound, causing "address already in use" on restart.

Fix by storing references to the server's event loop and thread, then
using call_soon_threadsafe(loop.stop) to signal the correct loop to exit.
The thread join ensures sockets are released before the next server starts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:16:47 +00:00
1ec05ea289 feat(dashboard): auto-stop server after 5 minutes idle
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 18s
CI / Test (push) Successful in 56s
CI / Release (push) Has been skipped
Replace pause-on-idle with full server shutdown after IDLE_SHUTDOWN_SECONDS
(default 5 minutes). Next visitor gets a fresh simulation instance.

- Idle checker stops server and clears st.cache_resource
- init_session_state detects stopped server and recreates fresh state
- Clears instruments and history for clean restart

Configurable via IDLE_SHUTDOWN_SECONDS environment variable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:57:23 +00:00
b826337b36 fix(dashboard): use st.cache_resource for server singleton
All checks were successful
CI / Lint (push) Successful in 5s
CI / Type Check (push) Successful in 19s
CI / Release (push) Has been skipped
CI / Test (push) Successful in 54s
Replace module-level singleton with @st.cache_resource decorator.
This properly survives Streamlit reruns without losing the server
reference, preventing "port already in use" errors when refreshing
the browser in Docker.

The cache is tied to the Streamlit process lifecycle, so when the
process restarts, both the cache and daemon threads are cleared
together.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:44:37 +00:00
235d668d9f fix(dashboard): handle orphan server on Docker refresh
All checks were successful
CI / Lint (push) Successful in 5s
CI / Type Check (push) Successful in 23s
CI / Test (push) Successful in 53s
CI / Release (push) Has been skipped
Check port availability before singleton state to detect orphan servers
from previous processes. When ports are in use but singleton is None,
wait up to 5 seconds for the orphan to shut down before failing with a
clear error message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:38:31 +00:00
13f93b6739 fix(dashboard): improve server singleton robustness
All checks were successful
CI / Lint (push) Successful in 5s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 56s
CI / Release (push) Has been skipped
- Add reuse_address=True to TCP server start to allow quick rebind
  after process restart (TIME_WAIT state)
- Add _is_server_responsive() check to verify server is actually
  responding, not just trusting the is_running flag which can be stale
  if the server thread died unexpectedly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:26:56 +00:00
bc15df3051 fix(dashboard): use module-level singleton to prevent port conflicts on refresh
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 20s
CI / Test (push) Successful in 56s
CI / Release (push) Has been skipped
When Streamlit refreshes/reruns, session state is lost but the old
simulation server thread keeps running on ports 5001-5003. This caused
"address already in use" errors when trying to start a new server.

Solution: Use a module-level singleton for the simulation server that
persists across Streamlit reruns. The get_or_create_server() function
checks if a server is already running before creating a new one.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:21:35 +00:00
66cdd4494c fix(docker): include README.md for pyproject.toml metadata
All checks were successful
CI / Test (push) Successful in 53s
CI / Release (push) Has been skipped
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
2026-01-29 22:38:52 +00:00
d1981a3342 fix(docker): use isolated public-network for security
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 54s
CI / Release (push) Has been skipped
2026-01-29 22:31:26 +00:00
45a2d9a6e5 fix(docker): use external apps-network for NPM integration
All checks were successful
CI / Test (push) Successful in 55s
CI / Release (push) Has been skipped
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 18s
2026-01-29 22:27:12 +00:00
51a479c61e fix(docker): use host nginx, fix libgdk-pixbuf package name
All checks were successful
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 52s
CI / Release (push) Has been skipped
- Update libgdk-pixbuf2.0-0 to libgdk-pixbuf-2.0-0 for Debian Trixie
- Remove bundled nginx container in favor of host nginx
- Use host networking for cloudflared to reach host nginx
- Expose streamlit on localhost:8080 for host nginx proxy
2026-01-29 22:24:02 +00:00
a6ef649090 Fix CI: install reports dependencies for tests
All checks were successful
CI / Lint (push) Successful in 5s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 1m8s
CI / Release (push) Has been skipped
2026-01-29 22:05:11 +00:00
45a8f11650 Fix linter errors in CLI and tests
Some checks failed
CI / Lint (push) Successful in 6s
CI / Type Check (push) Successful in 20s
CI / Test (push) Failing after 37s
CI / Release (push) Has been skipped
2026-01-29 22:00:59 +00:00
7e8943ac57 Update deployment: remove Fly.io, add self-hosted Docker setup
Some checks failed
CI / Lint (push) Failing after 4s
CI / Type Check (push) Successful in 30s
CI / Release (push) Has been cancelled
CI / Test (push) Has been cancelled
2026-01-29 21:57:27 +00:00
ddf2c9439d Simplify deployment - use physics pause instead of container shutdown
- IDLE_PAUSE_SECONDS replaces IDLE_TIMEOUT_MINUTES
- Container stays running, physics pauses when idle
- No restart mechanism needed
- Remove wakeup service (no longer needed)
2026-01-29 21:37:18 +00:00
9d6086a4e5 Auto-pause physics engine when no one is viewing
- Physics pauses after IDLE_PAUSE_SECONDS (default 30s) of inactivity
- Resumes instantly when someone views the dashboard
- No container restart needed - just pauses the simulation loop
- CPU usage drops to ~0% when paused
2026-01-29 21:36:38 +00:00
cc5a8191b0 Add idle auto-shutdown configuration to deployment
- IDLE_TIMEOUT_MINUTES env var (default 30 min)
- restart: no policy so container stays stopped
- Optional wakeup service for auto-restart
- Document three restart options in readme
2026-01-29 21:09:53 +00:00
b7663d5a31 Add idle auto-shutdown for self-hosted deployment
- IDLE_TIMEOUT_MINUTES env var to configure shutdown after inactivity
- Background thread monitors activity and exits when timeout reached
- Activity tracked via simulation_display fragment (runs while page open)
- Set to 0 (default) to disable auto-shutdown
2026-01-29 21:08:17 +00:00
6830b3158c Fix mypy type errors in reporting module 2026-01-29 18:06:13 +00:00
c016320b71 Update CHANGELOG with report generation feature 2026-01-29 18:03:39 +00:00
a5a2cf2473 Add report generation integration test 2026-01-29 18:03:23 +00:00
13a4fd16b3 Add reporting unit tests 2026-01-29 18:02:47 +00:00
349663b4e1 Add PDF download button to dashboard 2026-01-29 18:01:22 +00:00
2b92865745 Add export-report CLI command 2026-01-29 18:01:01 +00:00
022223af76 Add list-runs CLI command 2026-01-29 18:00:37 +00:00
bff13cd616 Add reporting configuration to default.yaml 2026-01-29 18:00:19 +00:00
59a5bc1124 Add ReportingConfig to application config 2026-01-29 18:00:04 +00:00
32daff69be Update reporting module public API 2026-01-29 17:59:45 +00:00
d76e610070 Implement ReportGenerator class 2026-01-29 17:59:27 +00:00
50432eaa3d Implement matplotlib chart generator 2026-01-29 17:59:01 +00:00
3b136dca69 Implement PDF renderer with WeasyPrint 2026-01-29 17:58:23 +00:00
5405ceec7f Implement HTML renderer with Jinja2 2026-01-29 17:58:02 +00:00
01d8295512 Add test report HTML template 2026-01-29 17:57:36 +00:00
3a8e6becf1 Add base HTML report template 2026-01-29 17:57:15 +00:00
af3116a025 Add professional CSS stylesheet for reports 2026-01-29 17:57:04 +00:00
f7f2839e65 Add reporting exception classes 2026-01-29 17:56:29 +00:00
5fdb1e6eaf Add report data models 2026-01-29 17:56:15 +00:00
ca7655704e Add matplotlib to reports dependencies 2026-01-29 17:55:55 +00:00
ba2ab9d5d8 Release v0.1.0
Some checks failed
CI / Release (push) Has been cancelled
CI / Lint (push) Successful in 4s
CI / Type Check (push) Successful in 19s
CI / Test (push) Successful in 37s
v0.1.0
2025-12-04 13:18:17 +00:00
64be5dacbf Fix Windows file locking in repository tests 2025-11-16 20:13:43 +00:00
a28752fc5b Polish dashboard UX and update README
- Wrap simulation controls in form to prevent page reruns on change
- Fix TempCo test configs to use 2+ temperature points
- Add Installation, Quick Start, and usage examples to README
2025-11-15 13:18:38 +00:00
5152f85c8e Fix dashboard: connect instruments on startup, remove broken reset, apply controls properly 2025-11-09 15:56:06 +00:00
bd0071e88f Fix: auto-start charts and remove ScriptRunContext warning from background thread 2025-11-07 22:06:56 +00:00
400f97e9fb Fix server initialization race condition with proper event signaling 2025-11-06 09:52:35 +00:00
cae52c1fa8 Improve dashboard UX: connect instruments before tests, clarify simulation controls, show error messages 2025-11-01 19:51:41 +00:00
7c89cebf0b Fix dashboard database initialization using temp file instead of in-memory 2025-10-27 17:34:45 +00:00
5d185815d0 Add end-to-end integration test 2025-10-23 21:23:18 +00:00
9cf42112a6 Add results viewer dashboard page 2025-10-22 13:22:56 +00:00
ed5362e712 Add test execution dashboard page 2025-10-17 11:13:32 +00:00