From bd774932d5701f39ca2d048d84bebbcfb84cc69d Mon Sep 17 00:00:00 2001 From: ITWorx Pulse release export Date: Thu, 3 Sep 2026 02:09:19 +0200 Subject: [PATCH] Publish ITWorx Pulse source --- .dockerignore | 18 + .editorconfig | 19 + .env.example | 88 + .gitattributes | 16 + .gitea/workflows/public-validation.yml | 52 + .gitignore | 77 + CHANGELOG.md | 20 + CONTRIBUTING.md | 22 + LICENSE | 661 ++++ Makefile | 43 + PACKAGE_VERSION | 1 + PUBLIC_SOURCE_EXPORT.md | 5 + PUBLIC_SOURCE_MANIFEST.json | 3066 +++++++++++++++++ README.md | 92 + SECURITY.md | 19 + apps/web/index.html | 14 + apps/web/package.json | 35 + apps/web/playwright.config.ts | 33 + apps/web/public/pulse-icon.svg | 21 + apps/web/src/AlertControlsPanel.tsx | 65 + apps/web/src/AlertOperationsPanel.tsx | 96 + apps/web/src/AlertRulesPage.tsx | 261 ++ apps/web/src/App.tsx | 807 +++++ apps/web/src/ApplicationPage.tsx | 47 + apps/web/src/ArrayPage.tsx | 32 + apps/web/src/CapacityPage.tsx | 52 + apps/web/src/ContainerPage.tsx | 144 + apps/web/src/DashboardEditor.tsx | 244 ++ apps/web/src/DashboardRuntimeWidget.tsx | 141 + apps/web/src/DashboardTransfer.tsx | 50 + apps/web/src/DashboardVariablesEditor.tsx | 41 + apps/web/src/DiskPage.tsx | 15 + apps/web/src/EventsPage.tsx | 110 + apps/web/src/HostPage.tsx | 90 + apps/web/src/IncidentPage.tsx | 46 + apps/web/src/InventoryPage.tsx | 140 + apps/web/src/MetricWidgets.tsx | 264 ++ apps/web/src/NetworkPage.tsx | 35 + apps/web/src/NotFoundPage.tsx | 11 + apps/web/src/OnboardingPage.tsx | 57 + apps/web/src/OperationalSignalPath.tsx | 75 + apps/web/src/PoolPage.tsx | 21 + apps/web/src/ProcessPage.tsx | 35 + apps/web/src/ServicePage.tsx | 184 + apps/web/src/SharePage.tsx | 14 + apps/web/src/SignIn.tsx | 43 + apps/web/src/SourceStatusDetails.tsx | 29 + apps/web/src/StoragePage.tsx | 50 + apps/web/src/StorageVisuals.tsx | 17 + apps/web/src/SystemStatusPage.tsx | 47 + apps/web/src/TopologyPage.tsx | 100 + apps/web/src/WidgetConfigDrawer.tsx | 103 + apps/web/src/auth.ts | 130 + apps/web/src/copy.ts | 881 +++++ apps/web/src/dashboardScope.ts | 24 + apps/web/src/listQuery.ts | 15 + apps/web/src/liveBuffer.ts | 168 + apps/web/src/liveClient.ts | 308 ++ apps/web/src/locale.ts | 33 + apps/web/src/main.tsx | 10 + apps/web/src/metricClient.ts | 40 + apps/web/src/overviewSignals.ts | 57 + apps/web/src/presentation.ts | 181 + apps/web/src/routes.ts | 15 + apps/web/src/styles.css | 1478 ++++++++ apps/web/src/systemStatus.ts | 220 ++ apps/web/src/useLiveMetric.ts | 89 + apps/web/src/useMetricQuery.ts | 23 + apps/web/src/vite-env.d.ts | 1 + apps/web/src/wallboardLayout.ts | 28 + apps/web/tests/e2e/accessibility.spec.ts | 129 + apps/web/tests/e2e/alert-workspace.spec.ts | 94 + apps/web/tests/e2e/capacity-real.spec.ts | 26 + apps/web/tests/e2e/core-visual-audit.spec.ts | 29 + .../tests/e2e/dashboard-editor-polish.spec.ts | 91 + .../tests/e2e/dashboard-real-sources.spec.ts | 40 + apps/web/tests/e2e/event-timeline.spec.ts | 74 + apps/web/tests/e2e/inventory-real.spec.ts | 30 + apps/web/tests/e2e/large-lists.spec.ts | 104 + .../tests/e2e/localized-alert-editor.spec.ts | 55 + .../tests/e2e/management-workspace.spec.ts | 85 + apps/web/tests/e2e/mobile-incident.spec.ts | 39 + apps/web/tests/e2e/real-stack.spec.ts | 198 ++ .../web/tests/e2e/release-backup-real.spec.ts | 33 + apps/web/tests/e2e/responsive-polish.spec.ts | 69 + .../web/tests/e2e/service-states-real.spec.ts | 30 + apps/web/tests/e2e/session-boundary.spec.ts | 23 + apps/web/tests/e2e/sol-ultra.spec.ts | 130 + .../e2e/source-status-presentation.spec.ts | 55 + apps/web/tests/e2e/storage-real-stack.spec.ts | 32 + apps/web/tests/e2e/wallboard-viewport.spec.ts | 62 + apps/web/tests/setup.ts | 15 + apps/web/tests/unit/AlertRulesPage.test.tsx | 126 + apps/web/tests/unit/AppOverview.test.tsx | 269 ++ apps/web/tests/unit/ApplicationPage.test.tsx | 43 + apps/web/tests/unit/ArrayPage.test.tsx | 24 + apps/web/tests/unit/CapacityPage.test.tsx | 40 + apps/web/tests/unit/ContainerPage.test.tsx | 48 + apps/web/tests/unit/DashboardCache.test.tsx | 30 + apps/web/tests/unit/EventsPage.test.tsx | 81 + apps/web/tests/unit/InventoryPage.test.tsx | 52 + apps/web/tests/unit/MetricWidgets.test.tsx | 81 + apps/web/tests/unit/NetworkPage.test.tsx | 41 + apps/web/tests/unit/OnboardingPage.test.tsx | 51 + .../tests/unit/OperationalSignalPath.test.tsx | 56 + apps/web/tests/unit/PoolPage.test.tsx | 25 + apps/web/tests/unit/ServicePage.test.tsx | 60 + .../tests/unit/SourceStatusDetails.test.tsx | 24 + apps/web/tests/unit/StoragePage.test.tsx | 30 + apps/web/tests/unit/StorageVisuals.test.tsx | 21 + apps/web/tests/unit/auth.test.ts | 35 + apps/web/tests/unit/dashboardScope.test.ts | 18 + apps/web/tests/unit/liveClient.test.ts | 121 + apps/web/tests/unit/locale.test.ts | 18 + apps/web/tests/unit/overviewSignals.test.ts | 27 + apps/web/tests/unit/presentation.test.ts | 53 + apps/web/tests/unit/routing.test.tsx | 24 + apps/web/tests/unit/systemStatus.test.ts | 112 + apps/web/tests/unit/useLiveMetric.test.tsx | 54 + apps/web/tests/unit/wallboardLayout.test.ts | 20 + apps/web/tsconfig.json | 20 + apps/web/vite.config.ts | 31 + cmd/agent/agent.go | 372 ++ cmd/agent/agent_test.go | 543 +++ cmd/agent/main.go | 157 + cmd/agent/store.go | 70 + cmd/api/main.go | 569 +++ cmd/api/session_live_test.go | 38 + cmd/api/source_health.go | 40 + cmd/api/source_health_test.go | 61 + cmd/migrate/main.go | 36 + cmd/worker/main.go | 324 ++ cmd/worker/main_test.go | 123 + config/README.md | 25 + config/alerts/default-rules.example.json | 173 + .../dashboards/default-overview.example.json | 331 ++ config/metrics/catalog.example.json | 397 +++ config/probes/probe.example.json | 23 + deploy/IMAGE_DIGESTS.md | 67 + deploy/agent.Dockerfile | 21 + deploy/api.Dockerfile | 17 + deploy/compose.dev.yaml | 19 + deploy/compose.prod.yaml | 65 + deploy/compose.real-source-smoke.yaml | 10 + deploy/compose.server-smoke.yaml | 22 + deploy/compose.smoke.yaml | 42 + deploy/compose.yaml | 306 ++ deploy/healthcheck-heartbeat.sh | 63 + deploy/migrate.Dockerfile | 13 + deploy/nginx.conf | 87 + deploy/postgres.Dockerfile | 37 + deploy/pulse-entrypoint.sh | 18 + deploy/smoke-fixture.Dockerfile | 12 + deploy/verify-image-digests.sh | 84 + deploy/web.Dockerfile | 20 + deploy/worker.Dockerfile | 19 + docs/PUBLIC_DEPLOYMENT.md | 46 + docs/PUBLIC_SOURCE_BOUNDARY.md | 19 + docs/REPOSITORY_BOUNDARY.md | 19 + docs/architecture/ALERTING_AND_INCIDENTS.md | 185 + docs/architecture/API_CONTRACT.md | 371 ++ docs/architecture/DATA_MODEL.md | 371 ++ docs/architecture/SECURITY_THREAT_MODEL.md | 248 ++ docs/architecture/SYSTEM_ARCHITECTURE.md | 240 ++ .../TELEMETRY_AND_QUERY_ENGINE.md | 168 + docs/architecture/adr/0001-read-only-v1.md | 19 + docs/architecture/adr/0002-go-react-stack.md | 17 + .../adr/0003-prometheus-v1-history.md | 17 + .../adr/0004-postgresql-domain-state.md | 18 + .../adr/0005-docker-access-boundary.md | 17 + docs/architecture/adr/0006-rest-websocket.md | 17 + docs/architecture/adr/0007-localization.md | 17 + .../architecture/adr/0008-stale-is-unknown.md | 18 + .../adr/0009-upstream-dependency-baseline.md | 42 + docs/engineering/BACKEND_STANDARDS.md | 95 + docs/engineering/CI_PIPELINE.md | 36 + docs/engineering/DEPENDENCIES.md | 35 + docs/engineering/DEPENDENCY_POLICY.md | 59 + docs/engineering/ENGINEERING_STANDARDS.md | 125 + docs/engineering/FRONTEND_STANDARDS.md | 92 + docs/engineering/PERFORMANCE_BUDGETS.md | 73 + docs/engineering/QUALITY_GATES.md | 121 + docs/engineering/TEST_STRATEGY.md | 137 + docs/operations/BACKUP_RESTORE.md | 128 + docs/operations/DEVELOPMENT_SETUP.md | 61 + docs/operations/OBSERVABILITY_OF_PULSE.md | 87 + .../WORKER_AGENT_HEALTHCHECK_CONTRACT.md | 118 + docs/product/MONITORING_REQUIREMENTS.md | 94 + docs/product/PRODUCT_REQUIREMENTS.md | 238 ++ docs/product/REQUIREMENTS_INDEX.md | 44 + docs/product/SERVICE_MONITORING.md | 83 + docs/product/STORAGE_MONITORING.md | 95 + docs/product/UX_SPEC.md | 308 ++ docs/product/WIDGET_CATALOG.md | 179 + fixtures/README.md | 16 + fixtures/scenarios/array-degraded.json | 36 + fixtures/scenarios/capacity-forecast.json | 22 + .../scenarios/container-restart-loop.json | 65 + fixtures/scenarios/database-restart.json | 37 + fixtures/scenarios/disk-temperature.json | 60 + .../scenarios/dns-outage-suppression.json | 44 + fixtures/scenarios/healthy-baseline.json | 60 + .../scenarios/pool-capacity-pressure.json | 42 + fixtures/scenarios/pool-degraded-scrub.json | 21 + fixtures/scenarios/probe-executor-cases.json | 33 + fixtures/scenarios/probe-scale-300.json | 15 + fixtures/scenarios/prometheus-stale.json | 50 + .../service-down-container-running.json | 53 + fixtures/scenarios/share-growth.json | 21 + fixtures/scenarios/smart-warning.json | 37 + fixtures/scenarios/storage-map-heatmap.json | 12 + fixtures/scenarios/ups-on-battery.json | 52 + fixtures/scenarios/websocket-slow-client.json | 43 + go.mod | 19 + go.sum | 34 + go.work | 3 + go.work.sum | 7 + internal/agentprotocol/protocol.go | 42 + internal/agentprotocol/protocol_test.go | 14 + internal/agentsource/agentsource.go | 289 ++ internal/agentsource/application.go | 212 ++ internal/agentsource/application_test.go | 210 ++ internal/agentsource/health_test.go | 68 + internal/agentsource/providers.go | 185 + internal/agentsource/providers_test.go | 423 +++ internal/agentstore/contract.go | 104 + internal/agentstore/postgres.go | 246 ++ .../agentstore/postgres_integration_test.go | 110 + internal/agentstore/postgres_test.go | 218 ++ internal/alert/alerts.go | 104 + internal/alert/grouping.go | 230 ++ internal/alert/grouping_test.go | 100 + internal/alert/operations.go | 99 + internal/alert/operations_integration_test.go | 71 + internal/alert/operations_test.go | 26 + internal/alert/repository.go | 357 ++ internal/alert/repository_integration_test.go | 87 + internal/alert/state.go | 261 ++ internal/alert/state_repository.go | 360 ++ .../state_repository_integration_test.go | 171 + internal/alert/state_test.go | 167 + internal/alert/types.go | 423 +++ internal/alert/types_test.go | 87 + internal/alertapi/handler.go | 293 ++ internal/alertapi/handler_test.go | 121 + internal/alertcontrol/expiry.go | 18 + internal/alertcontrol/repository.go | 342 ++ internal/alertcontrol/repository_test.go | 121 + internal/alertcontrol/runner.go | 26 + internal/alertcontrol/types.go | 245 ++ internal/alertcontrol/types_benchmark_test.go | 17 + internal/alertcontrol/types_test.go | 54 + internal/alertcontrolapi/handler.go | 252 ++ internal/alertcontrolapi/handler_test.go | 197 ++ internal/alertdefaults/seed.go | 111 + internal/alertdefaults/seed.json | 172 + .../alertdefaults/seed_integration_test.go | 55 + internal/alertdefaults/seed_test.go | 167 + internal/alertopsapi/handler.go | 202 ++ internal/alertopsapi/handler_test.go | 137 + internal/alertworker/memory_store.go | 69 + internal/alertworker/postgres_store.go | 89 + .../postgres_store_integration_test.go | 57 + internal/alertworker/worker.go | 273 ++ internal/alertworker/worker_test.go | 188 + internal/application/types.go | 244 ++ internal/application/types_test.go | 81 + internal/applicationapi/handler.go | 68 + internal/applicationapi/handler_test.go | 46 + internal/array/types.go | 398 +++ internal/array/types_test.go | 126 + internal/arrayapi/handler.go | 52 + internal/arrayapi/handler_test.go | 63 + internal/audit/audit.go | 85 + internal/audit/audit_test.go | 19 + internal/auth/oidc.go | 293 ++ internal/auth/oidc_test.go | 227 ++ internal/auth/session.go | 208 ++ internal/auth/session_test.go | 197 ++ internal/authapi/fakeidp_test.go | 159 + internal/authapi/flowstore.go | 116 + internal/authapi/flowstore_test.go | 154 + internal/authapi/handler.go | 347 ++ internal/authapi/handler_test.go | 578 ++++ internal/authapi/wiring_test.go | 72 + internal/backup/manager.go | 573 +++ internal/backup/manager_integration_test.go | 225 ++ internal/backup/manager_test.go | 70 + internal/backupapi/handler.go | 98 + internal/backupapi/handler_test.go | 44 + internal/buildinfo/buildinfo.go | 19 + internal/buildinfo/buildinfo_test.go | 25 + internal/config/config.go | 466 +++ internal/config/config_test.go | 259 ++ internal/container/types.go | 320 ++ internal/container/types_test.go | 117 + internal/containerapi/handler.go | 85 + internal/containerapi/handler_test.go | 57 + internal/correlation/correlation.go | 43 + internal/correlation/correlation_test.go | 39 + internal/dashboard/document.go | 86 + internal/dashboard/document_test.go | 32 + internal/dashboard/errors.go | 14 + .../immutability_integration_test.go | 42 + internal/dashboard/repository.go | 284 ++ .../dashboard/repository_integration_test.go | 113 + .../repository_scale_integration_test.go | 60 + internal/dashboard/version.go | 24 + internal/dashboardapi/handler.go | 407 +++ internal/dashboardapi/handler_test.go | 112 + internal/database/database.go | 129 + internal/database/database_test.go | 302 ++ .../database/migrations/0001_foundation.sql | 154 + .../database/migrations/0002_inventory.sql | 36 + .../0003_dashboard_immutability.sql | 11 + .../migrations/0004_dashboard_revision.sql | 6 + .../migrations/0005_services_probes.sql | 124 + .../database/migrations/0006_alert_rules.sql | 41 + .../0007_alert_evaluator_leases.sql | 6 + .../database/migrations/0008_alert_state.sql | 41 + .../migrations/0009_alert_hysteresis.sql | 8 + .../migrations/0010_alert_controls.sql | 42 + .../migrations/0011_alert_unacknowledge.sql | 8 + .../migrations/0012_notifications.sql | 42 + .../database/migrations/0013_incidents.sql | 48 + .../migrations/0014_incident_notes.sql | 9 + .../migrations/0015_entity_listing_index.sql | 1 + .../migrations/0016_agent_snapshots.sql | 17 + .../migrations/0017_worker_runtime.sql | 38 + .../0018_inventory_read_indexes.sql | 16 + .../migrations/0019_capacity_samples.sql | 14 + ...0020_service_certificate_history_index.sql | 2 + internal/datasource/contracts.go | 234 ++ internal/datasource/contracts_test.go | 46 + internal/discovery/jobs.go | 166 + internal/discovery/jobs_test.go | 51 + internal/discovery/postgres_store.go | 332 ++ .../postgres_store_integration_test.go | 99 + internal/disk/performance.go | 187 + internal/disk/performance_test.go | 52 + internal/disk/smart.go | 187 + internal/disk/smart_test.go | 55 + internal/disk/types.go | 398 +++ internal/disk/types_test.go | 108 + internal/diskapi/handler.go | 87 + internal/diskapi/handler_test.go | 52 + internal/eventapi/handler.go | 86 + internal/eventapi/handler_test.go | 44 + .../eventapi/postgres_integration_test.go | 61 + internal/forecast/storage.go | 211 ++ internal/forecast/storage_integration_test.go | 70 + internal/forecast/storage_test.go | 93 + internal/forecast/types.go | 275 ++ internal/forecast/types_test.go | 86 + internal/forecastapi/handler.go | 49 + internal/forecastapi/handler_test.go | 61 + internal/freshness/evaluator.go | 54 + internal/freshness/evaluator_test.go | 40 + internal/host/adapter.go | 38 + internal/host/hardware.go | 300 ++ internal/host/hardware_test.go | 70 + internal/host/types.go | 456 +++ internal/host/types_test.go | 108 + internal/hostapi/handler.go | 46 + internal/hostapi/handler_test.go | 51 + internal/hostcollect/clock_linux.go | 46 + internal/hostcollect/clock_other.go | 14 + internal/hostcollect/collector.go | 350 ++ internal/hostcollect/collector_test.go | 432 +++ internal/hostcollect/cpu.go | 180 + internal/hostcollect/errors.go | 10 + internal/hostcollect/filesystem.go | 139 + internal/hostcollect/loadavg.go | 36 + internal/hostcollect/memory.go | 71 + internal/hostcollect/network.go | 97 + internal/hostcollect/parse_test.go | 199 ++ internal/hostcollect/process.go | 352 ++ internal/hostcollect/process_test.go | 261 ++ internal/hostcollect/procfs.go | 67 + internal/hostcollect/statfs_linux.go | 39 + internal/hostcollect/statfs_other.go | 11 + .../testdata/proc-healthy/1/cmdline | Bin 0 -> 20 bytes .../hostcollect/testdata/proc-healthy/1/stat | 1 + .../testdata/proc-healthy/1/status | 11 + .../testdata/proc-healthy/1234/cmdline | Bin 0 -> 75 bytes .../testdata/proc-healthy/1234/stat | 1 + .../testdata/proc-healthy/1234/status | 5 + .../testdata/proc-healthy/2/cmdline | 0 .../hostcollect/testdata/proc-healthy/2/stat | 1 + .../testdata/proc-healthy/2/status | 6 + .../testdata/proc-healthy/3131/cmdline | Bin 0 -> 14 bytes .../testdata/proc-healthy/3131/status | 2 + .../testdata/proc-healthy/4567/cmdline | Bin 0 -> 29311 bytes .../testdata/proc-healthy/4567/stat | 1 + .../testdata/proc-healthy/4567/status | 5 + .../testdata/proc-healthy/5555/stat | 1 + .../testdata/proc-healthy/9999/stat | 1 + .../hostcollect/testdata/proc-healthy/loadavg | 1 + .../hostcollect/testdata/proc-healthy/meminfo | 16 + .../hostcollect/testdata/proc-healthy/mounts | 12 + .../hostcollect/testdata/proc-healthy/net/dev | 7 + .../testdata/proc-healthy/self/stat | 1 + .../hostcollect/testdata/proc-healthy/stat | 10 + .../testdata/proc-healthy/sys/kernel/hostname | 1 + .../proc-healthy/sys/kernel/osrelease | 1 + .../hostcollect/testdata/proc-healthy/uptime | 1 + .../hostcollect/testdata/proc-messy/loadavg | 1 + .../hostcollect/testdata/proc-messy/meminfo | 10 + .../hostcollect/testdata/proc-messy/mounts | 4 + .../hostcollect/testdata/proc-messy/net/dev | 2 + internal/hostcollect/testdata/proc-messy/stat | 6 + .../testdata/proc-messy/sys/kernel/hostname | 1 + .../hostcollect/testdata/proc-messy/uptime | 1 + .../sys-healthy/class/net/br0/operstate | 1 + .../sys-healthy/class/net/eth0/operstate | 1 + internal/hostcollect/uptime.go | 34 + internal/incident/owner_notes.go | 79 + internal/incident/repository.go | 275 ++ .../incident/repository_integration_test.go | 86 + internal/incident/types.go | 264 ++ internal/incident/types_test.go | 71 + internal/incidentapi/handler.go | 246 ++ internal/incidentapi/handler_test.go | 105 + internal/inventory/readmodel.go | 282 ++ internal/inventory/readmodel_test.go | 28 + internal/inventory/repository.go | 301 ++ .../inventory/repository_integration_test.go | 303 ++ internal/inventory/types.go | 53 + internal/inventoryapi/handler.go | 142 + internal/inventoryapi/handler_test.go | 108 + internal/lifecycle/types.go | 219 ++ internal/lifecycle/types_test.go | 50 + internal/live/backpressure_test.go | 15 + internal/live/live.go | 511 +++ internal/live/live_test.go | 222 ++ internal/live/registry.go | 243 ++ internal/live/registry_test.go | 185 + internal/livesampler/sampler.go | 395 +++ internal/livesampler/sampler_test.go | 338 ++ internal/m7gate/close_test.go | 86 + internal/metriccatalog/catalog.go | 318 ++ internal/metriccatalog/catalog_test.go | 122 + internal/metriccatalog/seed.json | 446 +++ internal/metricquery/handler.go | 125 + internal/metricquery/handler_test.go | 119 + internal/metricquery/service.go | 325 ++ internal/metricquery/service_test.go | 257 ++ internal/metricsapi/handler.go | 33 + internal/metricsapi/handler_test.go | 52 + internal/network/provider.go | 55 + internal/network/provider_test.go | 35 + internal/network/types.go | 424 +++ internal/network/types_test.go | 104 + internal/networkapi/handler.go | 43 + internal/networkapi/handler_test.go | 49 + internal/notification/dispatcher.go | 67 + internal/notification/dispatcher_test.go | 60 + internal/notification/repository.go | 463 +++ .../repository_integration_test.go | 249 ++ internal/notification/types.go | 216 ++ internal/notification/types_test.go | 78 + internal/notification/webhook.go | 182 + internal/notification/webhook_test.go | 144 + internal/observability/metrics.go | 304 ++ internal/observability/metrics_test.go | 63 + internal/onboarding/default-dashboard.json | 331 ++ .../onboarding/repository_integration_test.go | 56 + internal/onboarding/service.go | 222 ++ internal/onboarding/service_test.go | 73 + internal/onboarding/store.go | 53 + internal/onboarding/types.go | 37 + internal/onboardingapi/handler.go | 87 + internal/onboardingapi/handler_test.go | 65 + internal/pool/types.go | 537 +++ internal/pool/types_test.go | 135 + internal/poolapi/handler.go | 87 + internal/poolapi/handler_test.go | 54 + internal/probe/executor.go | 266 ++ internal/probe/executor_test.go | 246 ++ internal/probe/policy.go | 325 ++ internal/probe/policy_test.go | 109 + internal/probe/scenario_test.go | 52 + internal/probe/scheduler.go | 308 ++ internal/probe/scheduler_test.go | 160 + internal/probe/types.go | 92 + internal/probe/types_test.go | 19 + internal/problem/problem.go | 35 + internal/problem/problem_test.go | 34 + internal/process/types.go | 276 ++ internal/process/types_test.go | 89 + internal/processapi/handler.go | 67 + internal/processapi/handler_test.go | 51 + internal/prometheus/client.go | 189 + internal/prometheus/client_test.go | 135 + internal/promqlbinding/binding.go | 180 + internal/promqlbinding/binding_test.go | 143 + internal/queryplan/planner.go | 256 ++ internal/queryplan/planner_test.go | 121 + internal/reconciliation/container_identity.go | 209 ++ .../reconciliation/container_identity_test.go | 136 + internal/reconciliation/engine.go | 103 + internal/reconciliation/engine_test.go | 84 + internal/redaction/redaction.go | 39 + internal/redaction/redaction_test.go | 26 + internal/reverseproxy/http_client.go | 133 + internal/reverseproxy/http_client_test.go | 57 + internal/reverseproxy/types.go | 433 +++ internal/reverseproxy/types_test.go | 95 + internal/reverseproxyapi/handler.go | 57 + internal/reverseproxyapi/handler_test.go | 56 + internal/runtimeconfig/agent.go | 148 + internal/runtimeconfig/agent_test.go | 144 + internal/runtimeconfig/config.go | 91 + internal/runtimeconfig/config_test.go | 28 + internal/service/dependency.go | 135 + internal/service/dependency_repository.go | 237 ++ .../dependency_repository_integration_test.go | 110 + internal/service/dependency_test.go | 44 + internal/service/health.go | 25 + internal/service/health_test.go | 41 + internal/service/postgres.go | 182 + internal/service/postgres_integration_test.go | 89 + internal/service/scenario_test.go | 52 + internal/service/signal.go | 15 + internal/service/signal_test.go | 25 + internal/service/status.go | 411 +++ internal/service/status_test.go | 173 + internal/service/topology.go | 150 + .../service/topology_reverseproxy_test.go | 22 + internal/service/topology_test.go | 87 + internal/service/types.go | 69 + internal/service/types_test.go | 18 + internal/serviceapi/handler.go | 252 ++ internal/serviceapi/handler_test.go | 148 + internal/servicedefaults/seed.go | 203 ++ .../servicedefaults/seed_integration_test.go | 64 + internal/servicedefaults/seed_test.go | 54 + internal/share/types.go | 382 ++ internal/share/types_test.go | 71 + internal/shareapi/handler.go | 87 + internal/shareapi/handler_test.go | 50 + internal/storagescenarios/scenario_test.go | 107 + internal/systemstatus/status.go | 418 +++ internal/systemstatus/status_test.go | 195 ++ internal/systemstatusapi/handler.go | 76 + internal/systemstatusapi/handler_test.go | 45 + internal/unraid/array.go | 198 ++ internal/unraid/array_test.go | 58 + internal/unraid/client.go | 121 + internal/unraid/client_test.go | 89 + internal/unraid/containers.go | 111 + internal/unraid/containers_test.go | 105 + internal/unraid/pools.go | 69 + internal/unraid/pools_test.go | 50 + internal/unraid/shares.go | 73 + internal/unraid/shares_test.go | 32 + internal/widget/registry.go | 100 + internal/widget/registry_test.go | 22 + internal/widgetapi/handler.go | 68 + internal/widgetapi/handler_test.go | 81 + internal/widgetpreview/preview.go | 180 + internal/widgetpreview/preview_test.go | 49 + internal/workerruntime/alertjob.go | 515 +++ internal/workerruntime/discoveryjob.go | 620 ++++ .../inventory_discovery_integration_test.go | 105 + internal/workerruntime/jobs_test.go | 704 ++++ internal/workerruntime/lease.go | 272 ++ internal/workerruntime/metricsource_test.go | 66 + internal/workerruntime/notificationjob.go | 116 + .../postgres_integration_test.go | 196 ++ internal/workerruntime/probejob.go | 304 ++ internal/workerruntime/runtime.go | 562 +++ internal/workerruntime/runtime_test.go | 525 +++ internal/workerruntime/schedule.go | 76 + internal/workerruntime/status.go | 91 + package.json | 24 + pnpm-lock.yaml | 1818 ++++++++++ pnpm-workspace.yaml | 3 + requirements-dev.txt | 1 + scripts/bootstrap.ps1 | 13 + scripts/build.ps1 | 16 + scripts/export-public-source.mjs | 127 + scripts/integration-smoke.ps1 | 175 + scripts/lint.ps1 | 14 + scripts/production-smoke.ps1 | 126 + scripts/public-verify.ps1 | 36 + scripts/run-trivy-fs-scan.sh | 39 + scripts/test.ps1 | 14 + scripts/validate-public-source.mjs | 41 + scripts/wallboard-soak.ps1 | 71 + specs/alert-rule-set.schema.json | 16 + specs/alert-rule.schema.json | 171 + specs/api-routes.json | 99 + specs/capability.schema.json | 29 + specs/dashboard.schema.json | 125 + specs/entity.schema.json | 163 + specs/event.schema.json | 84 + specs/live-message.schema.json | 309 ++ specs/metric-catalog.schema.json | 16 + specs/metric-definition.schema.json | 197 ++ specs/probe.schema.json | 131 + specs/simulator-scenario.schema.json | 104 + specs/task-ledger.schema.json | 95 + specs/widget-instance.schema.json | 246 ++ tools/analyze-wallboard-soak.mjs | 75 + tools/check_api_contract.py | 77 + tools/check_secrets.py | 42 + tools/check_wiring.py | 329 ++ tools/deadman_check.py | 47 + tools/integrationfixture/main.go | 113 + tools/validate_contracts.py | 88 + tools/wallboard-soak-analysis.mjs | 89 + tools/wallboard-soak.mjs | 280 ++ tools/wiring_allowlist.json | 4 + 614 files changed, 77116 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitea/workflows/public-validation.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 PACKAGE_VERSION create mode 100644 PUBLIC_SOURCE_EXPORT.md create mode 100644 PUBLIC_SOURCE_MANIFEST.json create mode 100644 README.md create mode 100644 SECURITY.md create mode 100644 apps/web/index.html create mode 100644 apps/web/package.json create mode 100644 apps/web/playwright.config.ts create mode 100644 apps/web/public/pulse-icon.svg create mode 100644 apps/web/src/AlertControlsPanel.tsx create mode 100644 apps/web/src/AlertOperationsPanel.tsx create mode 100644 apps/web/src/AlertRulesPage.tsx create mode 100644 apps/web/src/App.tsx create mode 100644 apps/web/src/ApplicationPage.tsx create mode 100644 apps/web/src/ArrayPage.tsx create mode 100644 apps/web/src/CapacityPage.tsx create mode 100644 apps/web/src/ContainerPage.tsx create mode 100644 apps/web/src/DashboardEditor.tsx create mode 100644 apps/web/src/DashboardRuntimeWidget.tsx create mode 100644 apps/web/src/DashboardTransfer.tsx create mode 100644 apps/web/src/DashboardVariablesEditor.tsx create mode 100644 apps/web/src/DiskPage.tsx create mode 100644 apps/web/src/EventsPage.tsx create mode 100644 apps/web/src/HostPage.tsx create mode 100644 apps/web/src/IncidentPage.tsx create mode 100644 apps/web/src/InventoryPage.tsx create mode 100644 apps/web/src/MetricWidgets.tsx create mode 100644 apps/web/src/NetworkPage.tsx create mode 100644 apps/web/src/NotFoundPage.tsx create mode 100644 apps/web/src/OnboardingPage.tsx create mode 100644 apps/web/src/OperationalSignalPath.tsx create mode 100644 apps/web/src/PoolPage.tsx create mode 100644 apps/web/src/ProcessPage.tsx create mode 100644 apps/web/src/ServicePage.tsx create mode 100644 apps/web/src/SharePage.tsx create mode 100644 apps/web/src/SignIn.tsx create mode 100644 apps/web/src/SourceStatusDetails.tsx create mode 100644 apps/web/src/StoragePage.tsx create mode 100644 apps/web/src/StorageVisuals.tsx create mode 100644 apps/web/src/SystemStatusPage.tsx create mode 100644 apps/web/src/TopologyPage.tsx create mode 100644 apps/web/src/WidgetConfigDrawer.tsx create mode 100644 apps/web/src/auth.ts create mode 100644 apps/web/src/copy.ts create mode 100644 apps/web/src/dashboardScope.ts create mode 100644 apps/web/src/listQuery.ts create mode 100644 apps/web/src/liveBuffer.ts create mode 100644 apps/web/src/liveClient.ts create mode 100644 apps/web/src/locale.ts create mode 100644 apps/web/src/main.tsx create mode 100644 apps/web/src/metricClient.ts create mode 100644 apps/web/src/overviewSignals.ts create mode 100644 apps/web/src/presentation.ts create mode 100644 apps/web/src/routes.ts create mode 100644 apps/web/src/styles.css create mode 100644 apps/web/src/systemStatus.ts create mode 100644 apps/web/src/useLiveMetric.ts create mode 100644 apps/web/src/useMetricQuery.ts create mode 100644 apps/web/src/vite-env.d.ts create mode 100644 apps/web/src/wallboardLayout.ts create mode 100644 apps/web/tests/e2e/accessibility.spec.ts create mode 100644 apps/web/tests/e2e/alert-workspace.spec.ts create mode 100644 apps/web/tests/e2e/capacity-real.spec.ts create mode 100644 apps/web/tests/e2e/core-visual-audit.spec.ts create mode 100644 apps/web/tests/e2e/dashboard-editor-polish.spec.ts create mode 100644 apps/web/tests/e2e/dashboard-real-sources.spec.ts create mode 100644 apps/web/tests/e2e/event-timeline.spec.ts create mode 100644 apps/web/tests/e2e/inventory-real.spec.ts create mode 100644 apps/web/tests/e2e/large-lists.spec.ts create mode 100644 apps/web/tests/e2e/localized-alert-editor.spec.ts create mode 100644 apps/web/tests/e2e/management-workspace.spec.ts create mode 100644 apps/web/tests/e2e/mobile-incident.spec.ts create mode 100644 apps/web/tests/e2e/real-stack.spec.ts create mode 100644 apps/web/tests/e2e/release-backup-real.spec.ts create mode 100644 apps/web/tests/e2e/responsive-polish.spec.ts create mode 100644 apps/web/tests/e2e/service-states-real.spec.ts create mode 100644 apps/web/tests/e2e/session-boundary.spec.ts create mode 100644 apps/web/tests/e2e/sol-ultra.spec.ts create mode 100644 apps/web/tests/e2e/source-status-presentation.spec.ts create mode 100644 apps/web/tests/e2e/storage-real-stack.spec.ts create mode 100644 apps/web/tests/e2e/wallboard-viewport.spec.ts create mode 100644 apps/web/tests/setup.ts create mode 100644 apps/web/tests/unit/AlertRulesPage.test.tsx create mode 100644 apps/web/tests/unit/AppOverview.test.tsx create mode 100644 apps/web/tests/unit/ApplicationPage.test.tsx create mode 100644 apps/web/tests/unit/ArrayPage.test.tsx create mode 100644 apps/web/tests/unit/CapacityPage.test.tsx create mode 100644 apps/web/tests/unit/ContainerPage.test.tsx create mode 100644 apps/web/tests/unit/DashboardCache.test.tsx create mode 100644 apps/web/tests/unit/EventsPage.test.tsx create mode 100644 apps/web/tests/unit/InventoryPage.test.tsx create mode 100644 apps/web/tests/unit/MetricWidgets.test.tsx create mode 100644 apps/web/tests/unit/NetworkPage.test.tsx create mode 100644 apps/web/tests/unit/OnboardingPage.test.tsx create mode 100644 apps/web/tests/unit/OperationalSignalPath.test.tsx create mode 100644 apps/web/tests/unit/PoolPage.test.tsx create mode 100644 apps/web/tests/unit/ServicePage.test.tsx create mode 100644 apps/web/tests/unit/SourceStatusDetails.test.tsx create mode 100644 apps/web/tests/unit/StoragePage.test.tsx create mode 100644 apps/web/tests/unit/StorageVisuals.test.tsx create mode 100644 apps/web/tests/unit/auth.test.ts create mode 100644 apps/web/tests/unit/dashboardScope.test.ts create mode 100644 apps/web/tests/unit/liveClient.test.ts create mode 100644 apps/web/tests/unit/locale.test.ts create mode 100644 apps/web/tests/unit/overviewSignals.test.ts create mode 100644 apps/web/tests/unit/presentation.test.ts create mode 100644 apps/web/tests/unit/routing.test.tsx create mode 100644 apps/web/tests/unit/systemStatus.test.ts create mode 100644 apps/web/tests/unit/useLiveMetric.test.tsx create mode 100644 apps/web/tests/unit/wallboardLayout.test.ts create mode 100644 apps/web/tsconfig.json create mode 100644 apps/web/vite.config.ts create mode 100644 cmd/agent/agent.go create mode 100644 cmd/agent/agent_test.go create mode 100644 cmd/agent/main.go create mode 100644 cmd/agent/store.go create mode 100644 cmd/api/main.go create mode 100644 cmd/api/session_live_test.go create mode 100644 cmd/api/source_health.go create mode 100644 cmd/api/source_health_test.go create mode 100644 cmd/migrate/main.go create mode 100644 cmd/worker/main.go create mode 100644 cmd/worker/main_test.go create mode 100644 config/README.md create mode 100644 config/alerts/default-rules.example.json create mode 100644 config/dashboards/default-overview.example.json create mode 100644 config/metrics/catalog.example.json create mode 100644 config/probes/probe.example.json create mode 100644 deploy/IMAGE_DIGESTS.md create mode 100644 deploy/agent.Dockerfile create mode 100644 deploy/api.Dockerfile create mode 100644 deploy/compose.dev.yaml create mode 100644 deploy/compose.prod.yaml create mode 100644 deploy/compose.real-source-smoke.yaml create mode 100644 deploy/compose.server-smoke.yaml create mode 100644 deploy/compose.smoke.yaml create mode 100644 deploy/compose.yaml create mode 100644 deploy/healthcheck-heartbeat.sh create mode 100644 deploy/migrate.Dockerfile create mode 100644 deploy/nginx.conf create mode 100644 deploy/postgres.Dockerfile create mode 100644 deploy/pulse-entrypoint.sh create mode 100644 deploy/smoke-fixture.Dockerfile create mode 100644 deploy/verify-image-digests.sh create mode 100644 deploy/web.Dockerfile create mode 100644 deploy/worker.Dockerfile create mode 100644 docs/PUBLIC_DEPLOYMENT.md create mode 100644 docs/PUBLIC_SOURCE_BOUNDARY.md create mode 100644 docs/REPOSITORY_BOUNDARY.md create mode 100644 docs/architecture/ALERTING_AND_INCIDENTS.md create mode 100644 docs/architecture/API_CONTRACT.md create mode 100644 docs/architecture/DATA_MODEL.md create mode 100644 docs/architecture/SECURITY_THREAT_MODEL.md create mode 100644 docs/architecture/SYSTEM_ARCHITECTURE.md create mode 100644 docs/architecture/TELEMETRY_AND_QUERY_ENGINE.md create mode 100644 docs/architecture/adr/0001-read-only-v1.md create mode 100644 docs/architecture/adr/0002-go-react-stack.md create mode 100644 docs/architecture/adr/0003-prometheus-v1-history.md create mode 100644 docs/architecture/adr/0004-postgresql-domain-state.md create mode 100644 docs/architecture/adr/0005-docker-access-boundary.md create mode 100644 docs/architecture/adr/0006-rest-websocket.md create mode 100644 docs/architecture/adr/0007-localization.md create mode 100644 docs/architecture/adr/0008-stale-is-unknown.md create mode 100644 docs/architecture/adr/0009-upstream-dependency-baseline.md create mode 100644 docs/engineering/BACKEND_STANDARDS.md create mode 100644 docs/engineering/CI_PIPELINE.md create mode 100644 docs/engineering/DEPENDENCIES.md create mode 100644 docs/engineering/DEPENDENCY_POLICY.md create mode 100644 docs/engineering/ENGINEERING_STANDARDS.md create mode 100644 docs/engineering/FRONTEND_STANDARDS.md create mode 100644 docs/engineering/PERFORMANCE_BUDGETS.md create mode 100644 docs/engineering/QUALITY_GATES.md create mode 100644 docs/engineering/TEST_STRATEGY.md create mode 100644 docs/operations/BACKUP_RESTORE.md create mode 100644 docs/operations/DEVELOPMENT_SETUP.md create mode 100644 docs/operations/OBSERVABILITY_OF_PULSE.md create mode 100644 docs/operations/WORKER_AGENT_HEALTHCHECK_CONTRACT.md create mode 100644 docs/product/MONITORING_REQUIREMENTS.md create mode 100644 docs/product/PRODUCT_REQUIREMENTS.md create mode 100644 docs/product/REQUIREMENTS_INDEX.md create mode 100644 docs/product/SERVICE_MONITORING.md create mode 100644 docs/product/STORAGE_MONITORING.md create mode 100644 docs/product/UX_SPEC.md create mode 100644 docs/product/WIDGET_CATALOG.md create mode 100644 fixtures/README.md create mode 100644 fixtures/scenarios/array-degraded.json create mode 100644 fixtures/scenarios/capacity-forecast.json create mode 100644 fixtures/scenarios/container-restart-loop.json create mode 100644 fixtures/scenarios/database-restart.json create mode 100644 fixtures/scenarios/disk-temperature.json create mode 100644 fixtures/scenarios/dns-outage-suppression.json create mode 100644 fixtures/scenarios/healthy-baseline.json create mode 100644 fixtures/scenarios/pool-capacity-pressure.json create mode 100644 fixtures/scenarios/pool-degraded-scrub.json create mode 100644 fixtures/scenarios/probe-executor-cases.json create mode 100644 fixtures/scenarios/probe-scale-300.json create mode 100644 fixtures/scenarios/prometheus-stale.json create mode 100644 fixtures/scenarios/service-down-container-running.json create mode 100644 fixtures/scenarios/share-growth.json create mode 100644 fixtures/scenarios/smart-warning.json create mode 100644 fixtures/scenarios/storage-map-heatmap.json create mode 100644 fixtures/scenarios/ups-on-battery.json create mode 100644 fixtures/scenarios/websocket-slow-client.json create mode 100644 go.mod create mode 100644 go.sum create mode 100644 go.work create mode 100644 go.work.sum create mode 100644 internal/agentprotocol/protocol.go create mode 100644 internal/agentprotocol/protocol_test.go create mode 100644 internal/agentsource/agentsource.go create mode 100644 internal/agentsource/application.go create mode 100644 internal/agentsource/application_test.go create mode 100644 internal/agentsource/health_test.go create mode 100644 internal/agentsource/providers.go create mode 100644 internal/agentsource/providers_test.go create mode 100644 internal/agentstore/contract.go create mode 100644 internal/agentstore/postgres.go create mode 100644 internal/agentstore/postgres_integration_test.go create mode 100644 internal/agentstore/postgres_test.go create mode 100644 internal/alert/alerts.go create mode 100644 internal/alert/grouping.go create mode 100644 internal/alert/grouping_test.go create mode 100644 internal/alert/operations.go create mode 100644 internal/alert/operations_integration_test.go create mode 100644 internal/alert/operations_test.go create mode 100644 internal/alert/repository.go create mode 100644 internal/alert/repository_integration_test.go create mode 100644 internal/alert/state.go create mode 100644 internal/alert/state_repository.go create mode 100644 internal/alert/state_repository_integration_test.go create mode 100644 internal/alert/state_test.go create mode 100644 internal/alert/types.go create mode 100644 internal/alert/types_test.go create mode 100644 internal/alertapi/handler.go create mode 100644 internal/alertapi/handler_test.go create mode 100644 internal/alertcontrol/expiry.go create mode 100644 internal/alertcontrol/repository.go create mode 100644 internal/alertcontrol/repository_test.go create mode 100644 internal/alertcontrol/runner.go create mode 100644 internal/alertcontrol/types.go create mode 100644 internal/alertcontrol/types_benchmark_test.go create mode 100644 internal/alertcontrol/types_test.go create mode 100644 internal/alertcontrolapi/handler.go create mode 100644 internal/alertcontrolapi/handler_test.go create mode 100644 internal/alertdefaults/seed.go create mode 100644 internal/alertdefaults/seed.json create mode 100644 internal/alertdefaults/seed_integration_test.go create mode 100644 internal/alertdefaults/seed_test.go create mode 100644 internal/alertopsapi/handler.go create mode 100644 internal/alertopsapi/handler_test.go create mode 100644 internal/alertworker/memory_store.go create mode 100644 internal/alertworker/postgres_store.go create mode 100644 internal/alertworker/postgres_store_integration_test.go create mode 100644 internal/alertworker/worker.go create mode 100644 internal/alertworker/worker_test.go create mode 100644 internal/application/types.go create mode 100644 internal/application/types_test.go create mode 100644 internal/applicationapi/handler.go create mode 100644 internal/applicationapi/handler_test.go create mode 100644 internal/array/types.go create mode 100644 internal/array/types_test.go create mode 100644 internal/arrayapi/handler.go create mode 100644 internal/arrayapi/handler_test.go create mode 100644 internal/audit/audit.go create mode 100644 internal/audit/audit_test.go create mode 100644 internal/auth/oidc.go create mode 100644 internal/auth/oidc_test.go create mode 100644 internal/auth/session.go create mode 100644 internal/auth/session_test.go create mode 100644 internal/authapi/fakeidp_test.go create mode 100644 internal/authapi/flowstore.go create mode 100644 internal/authapi/flowstore_test.go create mode 100644 internal/authapi/handler.go create mode 100644 internal/authapi/handler_test.go create mode 100644 internal/authapi/wiring_test.go create mode 100644 internal/backup/manager.go create mode 100644 internal/backup/manager_integration_test.go create mode 100644 internal/backup/manager_test.go create mode 100644 internal/backupapi/handler.go create mode 100644 internal/backupapi/handler_test.go create mode 100644 internal/buildinfo/buildinfo.go create mode 100644 internal/buildinfo/buildinfo_test.go create mode 100644 internal/config/config.go create mode 100644 internal/config/config_test.go create mode 100644 internal/container/types.go create mode 100644 internal/container/types_test.go create mode 100644 internal/containerapi/handler.go create mode 100644 internal/containerapi/handler_test.go create mode 100644 internal/correlation/correlation.go create mode 100644 internal/correlation/correlation_test.go create mode 100644 internal/dashboard/document.go create mode 100644 internal/dashboard/document_test.go create mode 100644 internal/dashboard/errors.go create mode 100644 internal/dashboard/immutability_integration_test.go create mode 100644 internal/dashboard/repository.go create mode 100644 internal/dashboard/repository_integration_test.go create mode 100644 internal/dashboard/repository_scale_integration_test.go create mode 100644 internal/dashboard/version.go create mode 100644 internal/dashboardapi/handler.go create mode 100644 internal/dashboardapi/handler_test.go create mode 100644 internal/database/database.go create mode 100644 internal/database/database_test.go create mode 100644 internal/database/migrations/0001_foundation.sql create mode 100644 internal/database/migrations/0002_inventory.sql create mode 100644 internal/database/migrations/0003_dashboard_immutability.sql create mode 100644 internal/database/migrations/0004_dashboard_revision.sql create mode 100644 internal/database/migrations/0005_services_probes.sql create mode 100644 internal/database/migrations/0006_alert_rules.sql create mode 100644 internal/database/migrations/0007_alert_evaluator_leases.sql create mode 100644 internal/database/migrations/0008_alert_state.sql create mode 100644 internal/database/migrations/0009_alert_hysteresis.sql create mode 100644 internal/database/migrations/0010_alert_controls.sql create mode 100644 internal/database/migrations/0011_alert_unacknowledge.sql create mode 100644 internal/database/migrations/0012_notifications.sql create mode 100644 internal/database/migrations/0013_incidents.sql create mode 100644 internal/database/migrations/0014_incident_notes.sql create mode 100644 internal/database/migrations/0015_entity_listing_index.sql create mode 100644 internal/database/migrations/0016_agent_snapshots.sql create mode 100644 internal/database/migrations/0017_worker_runtime.sql create mode 100644 internal/database/migrations/0018_inventory_read_indexes.sql create mode 100644 internal/database/migrations/0019_capacity_samples.sql create mode 100644 internal/database/migrations/0020_service_certificate_history_index.sql create mode 100644 internal/datasource/contracts.go create mode 100644 internal/datasource/contracts_test.go create mode 100644 internal/discovery/jobs.go create mode 100644 internal/discovery/jobs_test.go create mode 100644 internal/discovery/postgres_store.go create mode 100644 internal/discovery/postgres_store_integration_test.go create mode 100644 internal/disk/performance.go create mode 100644 internal/disk/performance_test.go create mode 100644 internal/disk/smart.go create mode 100644 internal/disk/smart_test.go create mode 100644 internal/disk/types.go create mode 100644 internal/disk/types_test.go create mode 100644 internal/diskapi/handler.go create mode 100644 internal/diskapi/handler_test.go create mode 100644 internal/eventapi/handler.go create mode 100644 internal/eventapi/handler_test.go create mode 100644 internal/eventapi/postgres_integration_test.go create mode 100644 internal/forecast/storage.go create mode 100644 internal/forecast/storage_integration_test.go create mode 100644 internal/forecast/storage_test.go create mode 100644 internal/forecast/types.go create mode 100644 internal/forecast/types_test.go create mode 100644 internal/forecastapi/handler.go create mode 100644 internal/forecastapi/handler_test.go create mode 100644 internal/freshness/evaluator.go create mode 100644 internal/freshness/evaluator_test.go create mode 100644 internal/host/adapter.go create mode 100644 internal/host/hardware.go create mode 100644 internal/host/hardware_test.go create mode 100644 internal/host/types.go create mode 100644 internal/host/types_test.go create mode 100644 internal/hostapi/handler.go create mode 100644 internal/hostapi/handler_test.go create mode 100644 internal/hostcollect/clock_linux.go create mode 100644 internal/hostcollect/clock_other.go create mode 100644 internal/hostcollect/collector.go create mode 100644 internal/hostcollect/collector_test.go create mode 100644 internal/hostcollect/cpu.go create mode 100644 internal/hostcollect/errors.go create mode 100644 internal/hostcollect/filesystem.go create mode 100644 internal/hostcollect/loadavg.go create mode 100644 internal/hostcollect/memory.go create mode 100644 internal/hostcollect/network.go create mode 100644 internal/hostcollect/parse_test.go create mode 100644 internal/hostcollect/process.go create mode 100644 internal/hostcollect/process_test.go create mode 100644 internal/hostcollect/procfs.go create mode 100644 internal/hostcollect/statfs_linux.go create mode 100644 internal/hostcollect/statfs_other.go create mode 100644 internal/hostcollect/testdata/proc-healthy/1/cmdline create mode 100644 internal/hostcollect/testdata/proc-healthy/1/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/1/status create mode 100644 internal/hostcollect/testdata/proc-healthy/1234/cmdline create mode 100644 internal/hostcollect/testdata/proc-healthy/1234/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/1234/status create mode 100644 internal/hostcollect/testdata/proc-healthy/2/cmdline create mode 100644 internal/hostcollect/testdata/proc-healthy/2/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/2/status create mode 100644 internal/hostcollect/testdata/proc-healthy/3131/cmdline create mode 100644 internal/hostcollect/testdata/proc-healthy/3131/status create mode 100644 internal/hostcollect/testdata/proc-healthy/4567/cmdline create mode 100644 internal/hostcollect/testdata/proc-healthy/4567/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/4567/status create mode 100644 internal/hostcollect/testdata/proc-healthy/5555/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/9999/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/loadavg create mode 100644 internal/hostcollect/testdata/proc-healthy/meminfo create mode 100644 internal/hostcollect/testdata/proc-healthy/mounts create mode 100644 internal/hostcollect/testdata/proc-healthy/net/dev create mode 100644 internal/hostcollect/testdata/proc-healthy/self/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/stat create mode 100644 internal/hostcollect/testdata/proc-healthy/sys/kernel/hostname create mode 100644 internal/hostcollect/testdata/proc-healthy/sys/kernel/osrelease create mode 100644 internal/hostcollect/testdata/proc-healthy/uptime create mode 100644 internal/hostcollect/testdata/proc-messy/loadavg create mode 100644 internal/hostcollect/testdata/proc-messy/meminfo create mode 100644 internal/hostcollect/testdata/proc-messy/mounts create mode 100644 internal/hostcollect/testdata/proc-messy/net/dev create mode 100644 internal/hostcollect/testdata/proc-messy/stat create mode 100644 internal/hostcollect/testdata/proc-messy/sys/kernel/hostname create mode 100644 internal/hostcollect/testdata/proc-messy/uptime create mode 100644 internal/hostcollect/testdata/sys-healthy/class/net/br0/operstate create mode 100644 internal/hostcollect/testdata/sys-healthy/class/net/eth0/operstate create mode 100644 internal/hostcollect/uptime.go create mode 100644 internal/incident/owner_notes.go create mode 100644 internal/incident/repository.go create mode 100644 internal/incident/repository_integration_test.go create mode 100644 internal/incident/types.go create mode 100644 internal/incident/types_test.go create mode 100644 internal/incidentapi/handler.go create mode 100644 internal/incidentapi/handler_test.go create mode 100644 internal/inventory/readmodel.go create mode 100644 internal/inventory/readmodel_test.go create mode 100644 internal/inventory/repository.go create mode 100644 internal/inventory/repository_integration_test.go create mode 100644 internal/inventory/types.go create mode 100644 internal/inventoryapi/handler.go create mode 100644 internal/inventoryapi/handler_test.go create mode 100644 internal/lifecycle/types.go create mode 100644 internal/lifecycle/types_test.go create mode 100644 internal/live/backpressure_test.go create mode 100644 internal/live/live.go create mode 100644 internal/live/live_test.go create mode 100644 internal/live/registry.go create mode 100644 internal/live/registry_test.go create mode 100644 internal/livesampler/sampler.go create mode 100644 internal/livesampler/sampler_test.go create mode 100644 internal/m7gate/close_test.go create mode 100644 internal/metriccatalog/catalog.go create mode 100644 internal/metriccatalog/catalog_test.go create mode 100644 internal/metriccatalog/seed.json create mode 100644 internal/metricquery/handler.go create mode 100644 internal/metricquery/handler_test.go create mode 100644 internal/metricquery/service.go create mode 100644 internal/metricquery/service_test.go create mode 100644 internal/metricsapi/handler.go create mode 100644 internal/metricsapi/handler_test.go create mode 100644 internal/network/provider.go create mode 100644 internal/network/provider_test.go create mode 100644 internal/network/types.go create mode 100644 internal/network/types_test.go create mode 100644 internal/networkapi/handler.go create mode 100644 internal/networkapi/handler_test.go create mode 100644 internal/notification/dispatcher.go create mode 100644 internal/notification/dispatcher_test.go create mode 100644 internal/notification/repository.go create mode 100644 internal/notification/repository_integration_test.go create mode 100644 internal/notification/types.go create mode 100644 internal/notification/types_test.go create mode 100644 internal/notification/webhook.go create mode 100644 internal/notification/webhook_test.go create mode 100644 internal/observability/metrics.go create mode 100644 internal/observability/metrics_test.go create mode 100644 internal/onboarding/default-dashboard.json create mode 100644 internal/onboarding/repository_integration_test.go create mode 100644 internal/onboarding/service.go create mode 100644 internal/onboarding/service_test.go create mode 100644 internal/onboarding/store.go create mode 100644 internal/onboarding/types.go create mode 100644 internal/onboardingapi/handler.go create mode 100644 internal/onboardingapi/handler_test.go create mode 100644 internal/pool/types.go create mode 100644 internal/pool/types_test.go create mode 100644 internal/poolapi/handler.go create mode 100644 internal/poolapi/handler_test.go create mode 100644 internal/probe/executor.go create mode 100644 internal/probe/executor_test.go create mode 100644 internal/probe/policy.go create mode 100644 internal/probe/policy_test.go create mode 100644 internal/probe/scenario_test.go create mode 100644 internal/probe/scheduler.go create mode 100644 internal/probe/scheduler_test.go create mode 100644 internal/probe/types.go create mode 100644 internal/probe/types_test.go create mode 100644 internal/problem/problem.go create mode 100644 internal/problem/problem_test.go create mode 100644 internal/process/types.go create mode 100644 internal/process/types_test.go create mode 100644 internal/processapi/handler.go create mode 100644 internal/processapi/handler_test.go create mode 100644 internal/prometheus/client.go create mode 100644 internal/prometheus/client_test.go create mode 100644 internal/promqlbinding/binding.go create mode 100644 internal/promqlbinding/binding_test.go create mode 100644 internal/queryplan/planner.go create mode 100644 internal/queryplan/planner_test.go create mode 100644 internal/reconciliation/container_identity.go create mode 100644 internal/reconciliation/container_identity_test.go create mode 100644 internal/reconciliation/engine.go create mode 100644 internal/reconciliation/engine_test.go create mode 100644 internal/redaction/redaction.go create mode 100644 internal/redaction/redaction_test.go create mode 100644 internal/reverseproxy/http_client.go create mode 100644 internal/reverseproxy/http_client_test.go create mode 100644 internal/reverseproxy/types.go create mode 100644 internal/reverseproxy/types_test.go create mode 100644 internal/reverseproxyapi/handler.go create mode 100644 internal/reverseproxyapi/handler_test.go create mode 100644 internal/runtimeconfig/agent.go create mode 100644 internal/runtimeconfig/agent_test.go create mode 100644 internal/runtimeconfig/config.go create mode 100644 internal/runtimeconfig/config_test.go create mode 100644 internal/service/dependency.go create mode 100644 internal/service/dependency_repository.go create mode 100644 internal/service/dependency_repository_integration_test.go create mode 100644 internal/service/dependency_test.go create mode 100644 internal/service/health.go create mode 100644 internal/service/health_test.go create mode 100644 internal/service/postgres.go create mode 100644 internal/service/postgres_integration_test.go create mode 100644 internal/service/scenario_test.go create mode 100644 internal/service/signal.go create mode 100644 internal/service/signal_test.go create mode 100644 internal/service/status.go create mode 100644 internal/service/status_test.go create mode 100644 internal/service/topology.go create mode 100644 internal/service/topology_reverseproxy_test.go create mode 100644 internal/service/topology_test.go create mode 100644 internal/service/types.go create mode 100644 internal/service/types_test.go create mode 100644 internal/serviceapi/handler.go create mode 100644 internal/serviceapi/handler_test.go create mode 100644 internal/servicedefaults/seed.go create mode 100644 internal/servicedefaults/seed_integration_test.go create mode 100644 internal/servicedefaults/seed_test.go create mode 100644 internal/share/types.go create mode 100644 internal/share/types_test.go create mode 100644 internal/shareapi/handler.go create mode 100644 internal/shareapi/handler_test.go create mode 100644 internal/storagescenarios/scenario_test.go create mode 100644 internal/systemstatus/status.go create mode 100644 internal/systemstatus/status_test.go create mode 100644 internal/systemstatusapi/handler.go create mode 100644 internal/systemstatusapi/handler_test.go create mode 100644 internal/unraid/array.go create mode 100644 internal/unraid/array_test.go create mode 100644 internal/unraid/client.go create mode 100644 internal/unraid/client_test.go create mode 100644 internal/unraid/containers.go create mode 100644 internal/unraid/containers_test.go create mode 100644 internal/unraid/pools.go create mode 100644 internal/unraid/pools_test.go create mode 100644 internal/unraid/shares.go create mode 100644 internal/unraid/shares_test.go create mode 100644 internal/widget/registry.go create mode 100644 internal/widget/registry_test.go create mode 100644 internal/widgetapi/handler.go create mode 100644 internal/widgetapi/handler_test.go create mode 100644 internal/widgetpreview/preview.go create mode 100644 internal/widgetpreview/preview_test.go create mode 100644 internal/workerruntime/alertjob.go create mode 100644 internal/workerruntime/discoveryjob.go create mode 100644 internal/workerruntime/inventory_discovery_integration_test.go create mode 100644 internal/workerruntime/jobs_test.go create mode 100644 internal/workerruntime/lease.go create mode 100644 internal/workerruntime/metricsource_test.go create mode 100644 internal/workerruntime/notificationjob.go create mode 100644 internal/workerruntime/postgres_integration_test.go create mode 100644 internal/workerruntime/probejob.go create mode 100644 internal/workerruntime/runtime.go create mode 100644 internal/workerruntime/runtime_test.go create mode 100644 internal/workerruntime/schedule.go create mode 100644 internal/workerruntime/status.go create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 requirements-dev.txt create mode 100644 scripts/bootstrap.ps1 create mode 100644 scripts/build.ps1 create mode 100644 scripts/export-public-source.mjs create mode 100644 scripts/integration-smoke.ps1 create mode 100644 scripts/lint.ps1 create mode 100644 scripts/production-smoke.ps1 create mode 100644 scripts/public-verify.ps1 create mode 100644 scripts/run-trivy-fs-scan.sh create mode 100644 scripts/test.ps1 create mode 100644 scripts/validate-public-source.mjs create mode 100644 scripts/wallboard-soak.ps1 create mode 100644 specs/alert-rule-set.schema.json create mode 100644 specs/alert-rule.schema.json create mode 100644 specs/api-routes.json create mode 100644 specs/capability.schema.json create mode 100644 specs/dashboard.schema.json create mode 100644 specs/entity.schema.json create mode 100644 specs/event.schema.json create mode 100644 specs/live-message.schema.json create mode 100644 specs/metric-catalog.schema.json create mode 100644 specs/metric-definition.schema.json create mode 100644 specs/probe.schema.json create mode 100644 specs/simulator-scenario.schema.json create mode 100644 specs/task-ledger.schema.json create mode 100644 specs/widget-instance.schema.json create mode 100644 tools/analyze-wallboard-soak.mjs create mode 100644 tools/check_api_contract.py create mode 100644 tools/check_secrets.py create mode 100644 tools/check_wiring.py create mode 100644 tools/deadman_check.py create mode 100644 tools/integrationfixture/main.go create mode 100644 tools/validate_contracts.py create mode 100644 tools/wallboard-soak-analysis.mjs create mode 100644 tools/wallboard-soak.mjs create mode 100644 tools/wiring_allowlist.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..441ff33 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.codex +.agents +node_modules +**/node_modules +dist +**/dist +bin +tmp +coverage +artifacts/evidence +backups +.env +.env.* +!.env.example +*.log +*.sqlite +*.db diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c923d3c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.go] +indent_style = tab +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1eefbef --- /dev/null +++ b/.env.example @@ -0,0 +1,88 @@ +# General +PULSE_ENV=development +PULSE_TIMEZONE=Europe/Brussels +PULSE_DEFAULT_LOCALE=nl-BE +PULSE_LOG_LEVEL=info +PULSE_AUTH_MODE=mock + +# Public URL — select only after M0 conflict/discovery checks +PULSE_PUBLIC_URL=http://localhost:8080 + +# PostgreSQL +PULSE_DATABASE_URL=postgres://pulse:pulse-dev-only@postgres:5432/pulse?sslmode=disable + +# Metrics source +PULSE_PROMETHEUS_URL=http://prometheus:9090 +PULSE_PROMETHEUS_TIMEOUT=10s + +# Unraid — do not commit real tokens +PULSE_UNRAID_URL=https://unraid.example.invalid +PULSE_UNRAID_API_TOKEN= +# Production mounts this public certificate read-only; never put a private key here. +PULSE_UNRAID_CA_FILE_HOST=/path/to/unraid-ca.pem +# DNS name and address of the same Unraid host as used by PULSE_UNRAID_URL. +# Required by deploy/compose.prod.yaml; discover them instead of assuming host-gateway. +PULSE_UNRAID_HOST_NAME=unraid.example.test +PULSE_UNRAID_HOST_GATEWAY=192.0.2.10 + +# OIDC / Authentik +# Required when PULSE_AUTH_MODE=oidc; development may use the explicit mock mode above. +PULSE_OIDC_ISSUER=https://auth.example.invalid/application/o/pulse/ +PULSE_OIDC_CLIENT_ID=pulse +PULSE_OIDC_CLIENT_SECRET= +PULSE_OIDC_REDIRECT_URL=http://localhost:8080/auth/callback +# ID token claim carrying the group memberships used for role mapping. +PULSE_OIDC_GROUPS_CLAIM=groups +# Maps identity provider group claim values onto Pulse roles. Required in production: +# without it no identity can be granted a role and nobody can sign in. +# Roles: viewer, operator, editor, administrator. +PULSE_OIDC_ROLE_MAPPING=pulse-viewer=viewer,pulse-operator=operator,pulse-editor=editor,pulse-admin=administrator + +# Break-glass account must be disabled unless explicitly initialized securely +PULSE_BREAK_GLASS_ENABLED=false + +# pulse-agent — read-only host collector +# Identifies the agent in every snapshot and in the protocol hello. +PULSE_AGENT_ID=pulse-agent +# How often a full collection pass runs (1s–5m). The scheduling loop ticks faster when +# this is larger, so the heartbeat stays inside the healthcheck window. +PULSE_AGENT_COLLECT_INTERVAL=10s +# Read-only mounts of the host's kernel interfaces; compose bind mounts /proc and /sys. +PULSE_AGENT_PROC_ROOT=/host/proc +PULSE_AGENT_SYS_ROOT=/host/sys +# The host name as it should appear in Pulse. Inside a container the kernel reports the +# container's own name, so set this explicitly (for example: unraid-host). +PULSE_AGENT_HOST_NAME= +# Filesystem capacity and inode collection is off unless a host root is mounted +# read-only and named here (for example /host/root together with "- /:/host/root:ro"). +# Without it the agent reports no filesystems rather than measuring its own overlay. +PULSE_AGENT_FS_ROOT= +# Optional cap on the process inventory (1–5000); empty uses the domain default of 1000. +PULSE_AGENT_MAX_PROCESSES= + +# Liveness heartbeat file written by pulse-worker and pulse-agent after every completed +# loop iteration. See docs/operations/WORKER_AGENT_HEALTHCHECK_CONTRACT.md. +PULSE_HEARTBEAT_FILE=/tmp/healthy + +# pulse-worker — background runtime +# data_sources UUID container discovery is attributed to. Discovery stays Disabled +# until a source is registered, so inventory is never written against an unknown origin. +PULSE_CONTAINER_SOURCE_ID= +# Private/loopback CIDRs service probes may reach, comma separated (max 32). +# Empty keeps all private space blocked. Link-local, multicast and cloud metadata +# addresses stay blocked regardless of this value. +PULSE_PROBE_ALLOWED_NETWORKS= + +# Optional real notification receiver. The URL is stored as non-secret channel +# configuration; the bearer token remains runtime-only and is never persisted. +# Production requires HTTPS. The receiver should deduplicate by Idempotency-Key. +PULSE_NOTIFICATION_WEBHOOK_URL= +PULSE_NOTIFICATION_WEBHOOK_TOKEN= +PULSE_NOTIFICATION_WEBHOOK_TIMEOUT=10s + +# Production deployment (deploy/compose.prod.yaml) +# Host port pulse-web is published on. See ADR-0011. +PULSE_HOST_PORT=1238 +# Bind address for that port. Use 127.0.0.1 only if Nginx Proxy Manager reaches +# Pulse over a shared Docker network rather than over the host. +PULSE_PUBLISH_ADDRESS=0.0.0.0 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..512c0cf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +* text=auto eol=lf +*.ps1 text eol=crlf +*.png binary +*.jpg binary +*.jpeg binary +*.webp binary +*.zip binary + +# Keep release/source archives focused on product source and public documentation. +/.agents export-ignore +/.codex export-ignore +/MASTER_PROMPT.txt export-ignore +/planning export-ignore +/artifacts/evidence export-ignore +/AUDIT.md export-ignore +/PACKAGE_REPORT.md export-ignore diff --git a/.gitea/workflows/public-validation.yml b/.gitea/workflows/public-validation.yml new file mode 100644 index 0000000..6d16da4 --- /dev/null +++ b/.gitea/workflows/public-validation.yml @@ -0,0 +1,52 @@ +name: Public source validation + +on: + push: + pull_request: + +permissions: + contents: read + +concurrency: + group: public-validation-${{ gitea.repository }}-${{ gitea.event_name }}-${{ gitea.ref }} + cancel-in-progress: true + +jobs: + validate: + if: ${{ gitea.event_name != 'pull_request' || gitea.event.pull_request.head.repo.full_name == gitea.repository }} + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + with: + go-version-file: go.mod + cache: true + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: '24' + cache: pnpm + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + with: + version: '10.33.0' + - run: go test ./... && go vet ./... + - run: pnpm install --frozen-lockfile + - run: pnpm test && pnpm typecheck && pnpm lint && pnpm build + - name: Python contract and repository checks + shell: bash + run: | + set -euo pipefail + python3 -m venv "$RUNNER_TEMP/pulse-validation" + validation_python="$RUNNER_TEMP/pulse-validation/bin/python" + "$validation_python" -m pip install --disable-pip-version-check -r requirements-dev.txt + "$validation_python" tools/check_api_contract.py + "$validation_python" tools/validate_contracts.py + "$validation_python" tools/check_wiring.py + "$validation_python" tools/check_secrets.py + - run: bash deploy/verify-image-digests.sh + - name: Export reviewed public source + run: node scripts/export-public-source.mjs --output "$RUNNER_TEMP/pulse-public" + - name: Validate exported source manifest + run: cd "$RUNNER_TEMP/pulse-public" && node scripts/validate-public-source.mjs + - name: Dependency scan + run: sh scripts/run-trivy-fs-scan.sh "$RUNNER_TEMP/pulse-public" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a780d16 --- /dev/null +++ b/.gitignore @@ -0,0 +1,77 @@ +# Secrets and local configuration +.env +.env.* +!.env.example +*.pem +*.key +*.pfx +*.p12 +*.crt +secrets/ +credentials/ + +# Machine-local agent execution policy (tracked agent docs/skills remain intentional) +.codex/config.toml +.codex/config.local.toml +.claude/ + +# IDE / OS +.vscode/ +.idea/ +.vs/ +.DS_Store +Thumbs.db +*.swp + +# Node / frontend +node_modules/ +coverage/ +playwright-report/ +test-results/ +.next/ +dist/ +.npm/ +.pnpm-store/ + +# Go +bin/ +*.test +*.out +vendor/ + +# Python +__pycache__/ +*.py[cod] +.pytest_cache/ +.venv/ + +# Databases / runtime +*.db +*.db-shm +*.db-wal +*.sqlite +*.sqlite-shm +*.sqlite-wal +tmp/ +.cache/ +data/ +backups/local/ + +# Generated heavy evidence +artifacts/evidence/**/*.mp4 +artifacts/evidence/**/*.webm +artifacts/evidence/**/*.zip +artifacts/evidence/**/*.tar +artifacts/evidence/**/*.gz + +# Keep intentional evidence summaries, structured output and reviewed images +!artifacts/evidence/**/summary.md +!artifacts/evidence/**/*.json +!artifacts/evidence/**/*.txt +!artifacts/evidence/**/*.png +!artifacts/evidence/**/*.svg + +# Local scratch +_to_delete/ +artifacts/_audit_tmp/ +.playwright-mcp/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8a99eb7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable user-facing changes are recorded here. Private deployment evidence and environment-specific rollout details are deliberately excluded. + +## 1.5.0 + +- Added a mature Dutch operator interface with responsive overview, inventory, storage, service, alert, incident, settings, and wallboard flows. +- Expanded read-only Unraid and host collection for containers, processes, array, disks, pools, shares, capacity, and topology. +- Added bounded semantic metrics, historical queries, live WebSocket subscriptions, freshness handling, and explicit `Unknown` states. +- Added versioned dashboards, alert lifecycle, silences, maintenance, incident grouping, audit, and notification delivery controls. +- Added Authentik/OIDC, fail-closed role mapping, finite revocable sessions, and hardened production containers. +- Added portable checksummed backups, clean-room restore verification, production smoke checks, and deterministic release gates. + +## Public-readiness changes + +- Added a curated parentless public-source exporter and manifest validator. +- Added public deployment, security, and contribution guidance. +- Removed environment-specific defaults from portable configuration. +- Pinned third-party CI actions and added explicit read-only workflow permissions. +- Fixed personal-dashboard read authorization and bounded retained browser sessions. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b3fecab --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,22 @@ +# Contributing + +Contributions must preserve Pulse's read-only observability and evidence boundaries. + +Start with a focused issue or proposal for material behavior changes. Keep pull requests small enough to review, explain the user-visible outcome, and include tests for the changed boundary. + +- use synthetic telemetry and isolated test databases; +- never commit production dashboards, host inventories, credentials, backups or alert payloads; +- keep application changes separate from agent/planning/evidence updates; +- document new data collection, retention, authorization and network behaviour; +- run the repository's managed validation and the relevant Go, frontend, integration and Compose checks; +- retain provenance for screenshots and evidence summaries, and keep generated heavy artifacts outside Git. + +Changes that alter the read-only promise, OIDC/RBAC policy, backup format, agent privileges or deployment topology require explicit security review. Report sensitive findings through `SECURITY.md`. + +For a public source checkout, run: + +```powershell +pwsh -NoProfile -File scripts/public-verify.ps1 +``` + +Go code must be formatted with `gofmt`; frontend changes must pass tests, typecheck, lint, and build. Do not weaken a failing gate or replace a real integration boundary with a mock merely to obtain a green result. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..be3f7b2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a098f6e --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +.PHONY: validate state next sync test-harness contracts docs checksums wiring bootstrap build test lint verify + +validate: + python tools/projectctl.py validate + +state: + python tools/projectctl.py summary + +next: + python tools/projectctl.py next + +sync: + python tools/projectctl.py sync-md + +test-harness: + python -m unittest discover -s tools/tests -p "test_*.py" -v + +contracts: + python tools/validate_contracts.py + +docs: + python tools/check_docs.py + +checksums: + python tools/generate_checksums.py + +wiring: + python tools/check_wiring.py + +bootstrap: + pwsh -NoProfile -File scripts/bootstrap.ps1 + +build: + pwsh -NoProfile -File scripts/build.ps1 + +test: + pwsh -NoProfile -File scripts/test.ps1 + +lint: + pwsh -NoProfile -File scripts/lint.ps1 + +verify: + pwsh -NoProfile -File scripts/verify.ps1 diff --git a/PACKAGE_VERSION b/PACKAGE_VERSION new file mode 100644 index 0000000..bc80560 --- /dev/null +++ b/PACKAGE_VERSION @@ -0,0 +1 @@ +1.5.0 diff --git a/PUBLIC_SOURCE_EXPORT.md b/PUBLIC_SOURCE_EXPORT.md new file mode 100644 index 0000000..e8c8b25 --- /dev/null +++ b/PUBLIC_SOURCE_EXPORT.md @@ -0,0 +1,5 @@ +# Curated public source export + +Generated from private canonical revision `63254607a2e701e938a09d6e8f68e5bbc8fe83ac`. + +This parentless candidate excludes private operational history, evidence, planning, prompts, and machine-local agent configuration. diff --git a/PUBLIC_SOURCE_MANIFEST.json b/PUBLIC_SOURCE_MANIFEST.json new file mode 100644 index 0000000..7ccbb4d --- /dev/null +++ b/PUBLIC_SOURCE_MANIFEST.json @@ -0,0 +1,3066 @@ +{ + "schemaVersion": 1, + "sourceRevision": "63254607a2e701e938a09d6e8f68e5bbc8fe83ac", + "files": [ + { + "path": ".dockerignore", + "bytes": 152, + "sha256": "eecf5b3bdf673aff76da149d313c546c59ebbbd2a34891022d9ff52bf69b1db6" + }, + { + "path": ".editorconfig", + "bytes": 262, + "sha256": "ec1b98ee04298135d361bf4a77b480604495a80869287afa18e338ba2c26c749" + }, + { + "path": ".env.example", + "bytes": 4125, + "sha256": "ee98179f4f5b16065cbb178f793865e3793cb880297966a7b6fabe0e7339042e" + }, + { + "path": ".gitattributes", + "bytes": 383, + "sha256": "6fda06b89761f65661b1f5a7715bcc4a88add441ef4fff423f1b74837253f344" + }, + { + "path": ".gitea/workflows/public-validation.yml", + "bytes": 2057, + "sha256": "b7cb4ddeaf8de09eb137d7fa7456ec99e72689d67a4dcb6e8d767f183db71178" + }, + { + "path": ".gitignore", + "bytes": 1086, + "sha256": "c2a4061dc32143780539cfe747ee1f7d3bf9b7b46ce9c9c9150bdaac030c0b72" + }, + { + "path": "apps/web/index.html", + "bytes": 420, + "sha256": "d90d1366c6ce034ae6d5bfbe533bee3425d1f452a886cde72ded29ca52811b25" + }, + { + "path": "apps/web/package.json", + "bytes": 900, + "sha256": "5b6dae0ca3800a557424dee5445a19d5ca93de3afd62eec17499ff550cb4534d" + }, + { + "path": "apps/web/playwright.config.ts", + "bytes": 1399, + "sha256": "0cacb3ad04697c9e8160bd8a0461d8d8df191f1050cb158c96ccc29b6e1790e6" + }, + { + "path": "apps/web/public/pulse-icon.svg", + "bytes": 1344, + "sha256": "5bb39870be5d7cd321ea6f268e2e2edabc32f48db149d4944dbde45e79aea7fd" + }, + { + "path": "apps/web/src/AlertControlsPanel.tsx", + "bytes": 10037, + "sha256": "6730928affedab37f9312ddc60e45039ec51dfee406f83fe199a5c0e97fd8310" + }, + { + "path": "apps/web/src/AlertOperationsPanel.tsx", + "bytes": 7043, + "sha256": "e44d4c0c83d057cc1e5c6f1f653fac95e8bf3637b413e78c31d87c01a62072ae" + }, + { + "path": "apps/web/src/AlertRulesPage.tsx", + "bytes": 22530, + "sha256": "8232f652ffcd93ec4b7f207fb17eba6233162f3c0edc63af83c0fe960da41bdb" + }, + { + "path": "apps/web/src/App.tsx", + "bytes": 80954, + "sha256": "3df1d18ec0e66ebe06bfb70c8f8460bf7216b036ad46c47509fb7bad842de262" + }, + { + "path": "apps/web/src/ApplicationPage.tsx", + "bytes": 6061, + "sha256": "766634dd8f9aa401adbf3d93705b4be5e40f44d61573fa8cc384af0507d91fe8" + }, + { + "path": "apps/web/src/ArrayPage.tsx", + "bytes": 6324, + "sha256": "74f410a5e86154f508c6270a3d399c03a212146de87efc4ecd477c8cc237e5c8" + }, + { + "path": "apps/web/src/auth.ts", + "bytes": 5980, + "sha256": "5e1d5d891df1aedd237a8eab83757dcf68adc773828e26b20061179a4faaaf4e" + }, + { + "path": "apps/web/src/CapacityPage.tsx", + "bytes": 6215, + "sha256": "100e45e631770d6372526f72e8d19317242b34c5e612f0a3cbc8d43de28c15d8" + }, + { + "path": "apps/web/src/ContainerPage.tsx", + "bytes": 15609, + "sha256": "25a2c2c3aae5949cb0ff6e9a8f1ef428ba9e75c3a151e400a7573be3fd6e94df" + }, + { + "path": "apps/web/src/copy.ts", + "bytes": 68847, + "sha256": "2fcd7cef068486551f6a8b571a90a554a83a3250265c793c6ba61fc0616becec" + }, + { + "path": "apps/web/src/DashboardEditor.tsx", + "bytes": 24553, + "sha256": "2f59d5a4fdd404ab0e483ff9a74f7915df3adeec698459f03d6971d2d30b71fb" + }, + { + "path": "apps/web/src/DashboardRuntimeWidget.tsx", + "bytes": 11733, + "sha256": "afcc31e9d15792a0af3155efa72ceabbb4e69fdc1e076dee65c300148ba82245" + }, + { + "path": "apps/web/src/dashboardScope.ts", + "bytes": 1109, + "sha256": "d1c845a4861972ed07eceb7cad8e21e932f5d4a1712b0bfaaeb8a8a42dc13394" + }, + { + "path": "apps/web/src/DashboardTransfer.tsx", + "bytes": 4629, + "sha256": "ed0cb90ac87a83251c795c4ecd959d0c353062bcd9e5cd3ca61f7600e5e8fa8d" + }, + { + "path": "apps/web/src/DashboardVariablesEditor.tsx", + "bytes": 4920, + "sha256": "08cc0ed9b20a04395882613301a354c84f6575371470cade51e0fff5e752a37a" + }, + { + "path": "apps/web/src/DiskPage.tsx", + "bytes": 11773, + "sha256": "a1c774166e2bda25ab9f19e281ec47522b4ff26de2c7ffb718b657ee8d7dc19e" + }, + { + "path": "apps/web/src/EventsPage.tsx", + "bytes": 9585, + "sha256": "cebd5cf96501fe351b8d9c1c8d28878e46ccf9e56e55654e88a21f0ef6122395" + }, + { + "path": "apps/web/src/HostPage.tsx", + "bytes": 11304, + "sha256": "10c985f1cb23a5c03fe1ebced76a19606a5a1e9fc1e70d0858afcf3a0685409a" + }, + { + "path": "apps/web/src/IncidentPage.tsx", + "bytes": 10748, + "sha256": "b458bd558072f51a6f3495d0773c7e8a06d87f20f64b784f46b6612fdccf65aa" + }, + { + "path": "apps/web/src/InventoryPage.tsx", + "bytes": 15295, + "sha256": "a6111833dcdb50edee8562c80dc04dd2949290dca4a739f0fb4ddda771aafeae" + }, + { + "path": "apps/web/src/listQuery.ts", + "bytes": 734, + "sha256": "635160b05b40d0e464175ed9aee363a596f379c5f6853c07a83dcc12dcf0809c" + }, + { + "path": "apps/web/src/liveBuffer.ts", + "bytes": 6399, + "sha256": "3321274415d90f6340f4a54f7167e0b3fee1553ad5b6eb7962ad0e9e8c3192d0" + }, + { + "path": "apps/web/src/liveClient.ts", + "bytes": 12773, + "sha256": "88cd36f1d939b0714ca859e9bad97057f546fd162f8baafaf1d7303c03657066" + }, + { + "path": "apps/web/src/locale.ts", + "bytes": 1587, + "sha256": "e96efdd2a805b9e342072e03bd0b7921e2b9beccc75d84a169265e28e23bac36" + }, + { + "path": "apps/web/src/main.tsx", + "bytes": 232, + "sha256": "055735c1f2a805ceeca8a1376b884c7a8ae1b9d69ad42753b2d23b4e277bfebb" + }, + { + "path": "apps/web/src/metricClient.ts", + "bytes": 3443, + "sha256": "9210889b9083ad7badcf0d1b16ea7f7e8f498b0c91a9ab0a60f5c28e6eb078bb" + }, + { + "path": "apps/web/src/MetricWidgets.tsx", + "bytes": 21735, + "sha256": "8b367cc1aeed5bb170dc74a48e8c6f7e595fe0117ad8e2a4dcabc8ce028d58d0" + }, + { + "path": "apps/web/src/NetworkPage.tsx", + "bytes": 8009, + "sha256": "0e5861931c7661e1d67bb96643d981121072c4111e0c87bf5ef7ad537532f10c" + }, + { + "path": "apps/web/src/NotFoundPage.tsx", + "bytes": 523, + "sha256": "a20260e2b4cc6e1da7cb45e06e904f45ee874bda36e69fa719ffb833f7b30176" + }, + { + "path": "apps/web/src/OnboardingPage.tsx", + "bytes": 7273, + "sha256": "f40a6524b2dd6f770590c7bd21ac8df59c2f401983a5a8cd9535d9bfc0700bb8" + }, + { + "path": "apps/web/src/OperationalSignalPath.tsx", + "bytes": 4433, + "sha256": "4806735150b7630ac159ab21bd8604abb24a54b791ab7894164f00e3c26c3eda" + }, + { + "path": "apps/web/src/overviewSignals.ts", + "bytes": 2441, + "sha256": "9155c24e55531505d467d5b3fe8c5c7ca8981fba8ac8bc2a80d8f4fbc4f20b88" + }, + { + "path": "apps/web/src/PoolPage.tsx", + "bytes": 10387, + "sha256": "6689c1b227cef46de20777d788840252401d62e9710464886ec5261b9c1da623" + }, + { + "path": "apps/web/src/presentation.ts", + "bytes": 11813, + "sha256": "e9097597abd6a36cea451ebf3bb58eb0e9f4692d1f909892245fcf18f90fa1c2" + }, + { + "path": "apps/web/src/ProcessPage.tsx", + "bytes": 7291, + "sha256": "a84c5e3363ee193417b143d496efa97de9ee5776d70876a29d2ff2ae7eab6abe" + }, + { + "path": "apps/web/src/routes.ts", + "bytes": 1409, + "sha256": "541fb16e6eed1f89be5e67dcc9f212105a2ec8d1c3bc3dd212163829b4a65405" + }, + { + "path": "apps/web/src/ServicePage.tsx", + "bytes": 20623, + "sha256": "b564458e24fdf92ed01bd0c8bfefb60a73ad0d3dd1cbd1e7fb839924e5db881c" + }, + { + "path": "apps/web/src/SharePage.tsx", + "bytes": 8212, + "sha256": "bfd87cee394c7e01e20f66b1fe9d5a96c9e1670ea8af4106cfad3c2a88815abf" + }, + { + "path": "apps/web/src/SignIn.tsx", + "bytes": 2874, + "sha256": "cb3d44f469cea68fe3818a6ab86d62cf23ffbfea83fe2e737480eee8527f31b3" + }, + { + "path": "apps/web/src/SourceStatusDetails.tsx", + "bytes": 1823, + "sha256": "c9f1e2cb2ddb2b2df50b16aef5df8417ceec6194973671b5ca730fd63c0c1574" + }, + { + "path": "apps/web/src/StoragePage.tsx", + "bytes": 6521, + "sha256": "0c1939c57e0ea79fadf8a057263bed9be2ca5bf2a1d9f4cc661035f6da7450d1" + }, + { + "path": "apps/web/src/StorageVisuals.tsx", + "bytes": 3606, + "sha256": "c91262e86686a97fcc3bda2c27c653d7b33c14945b54dbafae21e227452fd48f" + }, + { + "path": "apps/web/src/styles.css", + "bytes": 116139, + "sha256": "a75362cfd509e2d0385322024e007c157b771b2504b41dda8a0fbdeb7a742f71" + }, + { + "path": "apps/web/src/systemStatus.ts", + "bytes": 10614, + "sha256": "8b458987f3772d59ff30776af0813d7550783159a79e3b077e69ca6451302f61" + }, + { + "path": "apps/web/src/SystemStatusPage.tsx", + "bytes": 5558, + "sha256": "05de01cbb09ba79c5c4093062df244c0d9a569b1fe3f0198848baeaee73feeae" + }, + { + "path": "apps/web/src/TopologyPage.tsx", + "bytes": 9295, + "sha256": "7b3b7b7a4d8af2464887a13825e834ac350356597e259d98dcd3365713f2ea47" + }, + { + "path": "apps/web/src/useLiveMetric.ts", + "bytes": 4057, + "sha256": "0e57c1aaf89ce38ddbe27b351b11b32d3bd7cb898a964b011f080fd735001b15" + }, + { + "path": "apps/web/src/useMetricQuery.ts", + "bytes": 1333, + "sha256": "19914f0fbf20301757d404788c0b71bf6024d508cd5c8434acbce454001e12fc" + }, + { + "path": "apps/web/src/vite-env.d.ts", + "bytes": 38, + "sha256": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" + }, + { + "path": "apps/web/src/wallboardLayout.ts", + "bytes": 1246, + "sha256": "4c7e2cc144eb49a6cabb7a1a436761db69c20adbb08100ae5300cab71a926982" + }, + { + "path": "apps/web/src/WidgetConfigDrawer.tsx", + "bytes": 9669, + "sha256": "5da5698c08e0148360c988d2b5b00e3cb8c97008c3328e6507348027bca3383d" + }, + { + "path": "apps/web/tests/e2e/accessibility.spec.ts", + "bytes": 7458, + "sha256": "35944ead608edc8ed86870d6ae14dd939d3c5da739c11fa36c717af112ad11d3" + }, + { + "path": "apps/web/tests/e2e/alert-workspace.spec.ts", + "bytes": 5618, + "sha256": "ebb6c7d538c73aa5b0d7ed699adadbdf34d9cec85eea993478ff10963b5115f5" + }, + { + "path": "apps/web/tests/e2e/capacity-real.spec.ts", + "bytes": 1634, + "sha256": "fbc0bb3bdeae6b3069e40a1f37b0eaaf73fac7a9fa22d1e93398a7ff31f3e035" + }, + { + "path": "apps/web/tests/e2e/core-visual-audit.spec.ts", + "bytes": 1890, + "sha256": "b736ff755f290490f16bdb595bb3d6b89594866ffd2173b26f39e99de6c3e0ba" + }, + { + "path": "apps/web/tests/e2e/dashboard-editor-polish.spec.ts", + "bytes": 6441, + "sha256": "31845e92fe0c253307baff8d2e833ae52c60794f4976c619b881770803abc8b6" + }, + { + "path": "apps/web/tests/e2e/dashboard-real-sources.spec.ts", + "bytes": 2676, + "sha256": "0d5bcffdadd3a2ce585a5395400928c5be85c2c1797c863737175d0fa7e32262" + }, + { + "path": "apps/web/tests/e2e/event-timeline.spec.ts", + "bytes": 4065, + "sha256": "d1916f121fdebc99249b25f21291c4c80ae5988329ed5abbb5e4c26fb7bf5f92" + }, + { + "path": "apps/web/tests/e2e/inventory-real.spec.ts", + "bytes": 1889, + "sha256": "c07fe7c49280c0ffe97823878a7ea899881dc2a13be4e45605bc557d0dab46ab" + }, + { + "path": "apps/web/tests/e2e/large-lists.spec.ts", + "bytes": 7534, + "sha256": "4465cce0cfb1f1dedce6bf276e047ddd3428f1852aef0b7003797ae9417a319d" + }, + { + "path": "apps/web/tests/e2e/localized-alert-editor.spec.ts", + "bytes": 4297, + "sha256": "fdca3979ea4e31ddde551974958a516ad9bf37c7b5c8ab5e2f75267f44fe71e6" + }, + { + "path": "apps/web/tests/e2e/management-workspace.spec.ts", + "bytes": 5055, + "sha256": "221dc1c37a3fc380c0a27fba57b8154907eac215d8a54a29033aa7c906fc0f63" + }, + { + "path": "apps/web/tests/e2e/mobile-incident.spec.ts", + "bytes": 2724, + "sha256": "5bcdfde067adb2280009d42fd265b51f52230f94368e81e4e1da772b70fa393e" + }, + { + "path": "apps/web/tests/e2e/real-stack.spec.ts", + "bytes": 12745, + "sha256": "80c4c55191786dbfcabb076338759861cf722c01ca8a32f5281f8bbaeabd45c5" + }, + { + "path": "apps/web/tests/e2e/release-backup-real.spec.ts", + "bytes": 1774, + "sha256": "f606b0b1f8c0872e5b7661bddbe328a2749ba432eae7466e1c68245167a0d7dc" + }, + { + "path": "apps/web/tests/e2e/responsive-polish.spec.ts", + "bytes": 4497, + "sha256": "5a1303cb00934b80743332b9ce962010e99f7057509a8c3fb9db5d12729c428a" + }, + { + "path": "apps/web/tests/e2e/service-states-real.spec.ts", + "bytes": 1610, + "sha256": "6e044d8c3164523b50d62edde3d616974bbeb7219d58a6bd3825192fb5f15dff" + }, + { + "path": "apps/web/tests/e2e/session-boundary.spec.ts", + "bytes": 1226, + "sha256": "9516efacb2c7290f4c6fee415490c94cb412d811f001d8bd9caa88cb37ff894a" + }, + { + "path": "apps/web/tests/e2e/sol-ultra.spec.ts", + "bytes": 7478, + "sha256": "112cd3efa16c1ced5e443c998db019ec2760b0c022d2382312152edbf14ea778" + }, + { + "path": "apps/web/tests/e2e/source-status-presentation.spec.ts", + "bytes": 3151, + "sha256": "264532c6c60f1081b21c38918ab6922d1f78af2c8fe729d5cb8c35818361e390" + }, + { + "path": "apps/web/tests/e2e/storage-real-stack.spec.ts", + "bytes": 2210, + "sha256": "8c4b7ca4109a36ce98c4737a468498eea613715b7ff6e28fd89185b5b3b93cac" + }, + { + "path": "apps/web/tests/e2e/wallboard-viewport.spec.ts", + "bytes": 5007, + "sha256": "554814b8620117613768984ed5b73e2aecf177cd7698c3d2d06e9b5bf77ea7f1" + }, + { + "path": "apps/web/tests/setup.ts", + "bytes": 391, + "sha256": "3ee621a63db2fcc2441e86bdb40680f5552b2e39d4b86151eb3c0686a0d69999" + }, + { + "path": "apps/web/tests/unit/AlertRulesPage.test.tsx", + "bytes": 8259, + "sha256": "f1b1b9c7bda5ec54196a4f11fa77f83ded78c139f2ffb65a6a4dc758aa3cf87e" + }, + { + "path": "apps/web/tests/unit/ApplicationPage.test.tsx", + "bytes": 2117, + "sha256": "79cd6dee1b12a1487908c4e4e6fbf9450d5ac1f5e90ba087820296e501b15d92" + }, + { + "path": "apps/web/tests/unit/AppOverview.test.tsx", + "bytes": 18353, + "sha256": "0dd586b1a1d02c9ad8738c3e0dff0429d838477e8cbab58037ea08e6c41639c7" + }, + { + "path": "apps/web/tests/unit/ArrayPage.test.tsx", + "bytes": 931, + "sha256": "147816cb44c48194733450f4a903be4ae385655bebb862c4ebbb907c15d0f66d" + }, + { + "path": "apps/web/tests/unit/auth.test.ts", + "bytes": 1577, + "sha256": "e5ecaaefed7fb68bccef56fdc70f1ad3c87a6ce7336ca164e9efd3698960d077" + }, + { + "path": "apps/web/tests/unit/CapacityPage.test.tsx", + "bytes": 2116, + "sha256": "48e58bfd4198a24e0a088d6463d1c577e34aa3c104f0a182b696699c192a48b6" + }, + { + "path": "apps/web/tests/unit/ContainerPage.test.tsx", + "bytes": 3310, + "sha256": "2244c5783e649649f89858201a8382e8584d8a41ab7c5fe4de3ec35ea037ade0" + }, + { + "path": "apps/web/tests/unit/DashboardCache.test.tsx", + "bytes": 1306, + "sha256": "b191df5032d853ac678908f125e8e6ab8fdb761fe0547bb906521c37dcbca2cb" + }, + { + "path": "apps/web/tests/unit/dashboardScope.test.ts", + "bytes": 767, + "sha256": "b9772bd9da6d0e2c4933c980d519cb478fb24de0ae678e95e40c37fb84a70aee" + }, + { + "path": "apps/web/tests/unit/EventsPage.test.tsx", + "bytes": 3781, + "sha256": "474887a6b4d7f86418e6f42fde0513a26188c3d6868db93a0d94d62ae80848a2" + }, + { + "path": "apps/web/tests/unit/InventoryPage.test.tsx", + "bytes": 4120, + "sha256": "9aa3cb3c865b338a10ad291601a44b11771f2ca8e166d7f6f0d59359ee2fb5c4" + }, + { + "path": "apps/web/tests/unit/liveClient.test.ts", + "bytes": 4967, + "sha256": "3c65de0e3e2be1813406187d085423678e5f231be2c6040b6e784ca7f9995d70" + }, + { + "path": "apps/web/tests/unit/locale.test.ts", + "bytes": 779, + "sha256": "b9ce76ed4b9f8ad987ca654c2439f29fe3b53a707453b855bdacd41b77c36044" + }, + { + "path": "apps/web/tests/unit/MetricWidgets.test.tsx", + "bytes": 3660, + "sha256": "e53b9b9df1bd402f852bf91dcb3954f5f54b80a42105012fd9248f864ece9286" + }, + { + "path": "apps/web/tests/unit/NetworkPage.test.tsx", + "bytes": 1910, + "sha256": "e3549dfa0df5712e045effbe75681511bc632d7ea9bb74046b63438cfbab58f8" + }, + { + "path": "apps/web/tests/unit/OnboardingPage.test.tsx", + "bytes": 2730, + "sha256": "a8cebdaf90b8de00831da46c6e6582beff8a59714ce0861a93022a1aec42d155" + }, + { + "path": "apps/web/tests/unit/OperationalSignalPath.test.tsx", + "bytes": 2735, + "sha256": "0420a4fe6a8c2bbe27e5bbc54c655748ea218fc70ec16bcb45561d66d0110a34" + }, + { + "path": "apps/web/tests/unit/overviewSignals.test.ts", + "bytes": 1571, + "sha256": "3bdb3a5adef133fff8194b55707752c1a8fdd010c072b1f10a00f0f907797b62" + }, + { + "path": "apps/web/tests/unit/PoolPage.test.tsx", + "bytes": 1438, + "sha256": "204808c12471f3c4a665895887ebf76ff679aab9cc1cb7cd8047e520f9468c93" + }, + { + "path": "apps/web/tests/unit/presentation.test.ts", + "bytes": 3257, + "sha256": "7977ce5372b0a82639d2b93fdd91a97ebd0c888ff586e68f144033f9eef220c4" + }, + { + "path": "apps/web/tests/unit/routing.test.tsx", + "bytes": 1366, + "sha256": "0524a17452c3204515dc9b16a7eac22aa737a8d25524c52fcd1acb31e0018098" + }, + { + "path": "apps/web/tests/unit/ServicePage.test.tsx", + "bytes": 3022, + "sha256": "27b22902980f5ee3441775554d8dc23759cf830fde53365dfceb71585bc4c84c" + }, + { + "path": "apps/web/tests/unit/SourceStatusDetails.test.tsx", + "bytes": 1237, + "sha256": "26dd31698a625db7571ecbca45e724d10bced9f29a1235a3e0dd064423b750b4" + }, + { + "path": "apps/web/tests/unit/StoragePage.test.tsx", + "bytes": 1846, + "sha256": "24ec69a33eb4647eeb1bd568bec154181caa08c96be81bf4b0ec655d15e6cd41" + }, + { + "path": "apps/web/tests/unit/StorageVisuals.test.tsx", + "bytes": 1162, + "sha256": "8ed8d62ddb8834ec375621b00afb667c92deba222e745167ec6ff6786ab0da0c" + }, + { + "path": "apps/web/tests/unit/systemStatus.test.ts", + "bytes": 5856, + "sha256": "349df0f38d32b3c913ed096783edeff324a7026497d9c67638a843c61f7384d6" + }, + { + "path": "apps/web/tests/unit/useLiveMetric.test.tsx", + "bytes": 2016, + "sha256": "29420e6ba4a4a6a3bc3461e52121a452483a9322ef885a0a8946e712b2893083" + }, + { + "path": "apps/web/tests/unit/wallboardLayout.test.ts", + "bytes": 982, + "sha256": "b8cc31caa1968720117bd98a65c0254fa1d68167864655009fbddb4b032e2c1f" + }, + { + "path": "apps/web/tsconfig.json", + "bytes": 558, + "sha256": "c075b6380c83f6206463d6993339998ca9c7c8df770bf7f8662193f530e65581" + }, + { + "path": "apps/web/vite.config.ts", + "bytes": 977, + "sha256": "f06930f44169b28ccfbf392d365e29d0e75d66724a21cad444cc456e165891d1" + }, + { + "path": "CHANGELOG.md", + "bytes": 1360, + "sha256": "376bb43c941d0a1fc1f8f5d9b937375d22d271555402bd326e7843a34c8129d7" + }, + { + "path": "cmd/agent/agent_test.go", + "bytes": 18329, + "sha256": "4438e755f3141bd752e15c7d0cefc69b7cfc30a8bcdfb3b84fdfda0c3dbcdf73" + }, + { + "path": "cmd/agent/agent.go", + "bytes": 12496, + "sha256": "7e3cafb05a8bad6871119acbe96f621dc9a5d42de39b0c061363de95a96c5eb6" + }, + { + "path": "cmd/agent/main.go", + "bytes": 5045, + "sha256": "bdb31f6ab3b992eeb1bee7cc8b40bb8e1869d670a6ef6406733e6c5d18d386f4" + }, + { + "path": "cmd/agent/store.go", + "bytes": 2592, + "sha256": "277b1430bbaefc12a9beeb533fe2849c1b9e83866f8fe4f5bf456992e68dcd3c" + }, + { + "path": "cmd/api/main.go", + "bytes": 28573, + "sha256": "5ad373b907a97886b2871da6a1186b77fd711854c24bac2dfa6b7940cf96df58" + }, + { + "path": "cmd/api/session_live_test.go", + "bytes": 1328, + "sha256": "33ec9ad578a8c91c4d1bf4c37ffd1ea60e006cbf304361e1cef55f69aaf5beda" + }, + { + "path": "cmd/api/source_health_test.go", + "bytes": 2205, + "sha256": "3dd67f4da5960259136bf03e8926b92a33130c0122bb30db00815bda48ba5823" + }, + { + "path": "cmd/api/source_health.go", + "bytes": 1334, + "sha256": "b607dd141d60a878d726b0481b40a7ed095dd2edc320c57cbf1e9fc90d793c14" + }, + { + "path": "cmd/migrate/main.go", + "bytes": 780, + "sha256": "5969dbc925b5d1a58b8bd35d7cf243e4118f02aebbdc3fe995f5b54ecb910775" + }, + { + "path": "cmd/worker/main_test.go", + "bytes": 4642, + "sha256": "e2d848590ee593a143ca1488f3714ddf00e6f957ea81ef3497807edefda98730" + }, + { + "path": "cmd/worker/main.go", + "bytes": 12302, + "sha256": "691eaaefaf05f297c03df4cab4826cee468df86d01e079cd01274d59685640d8" + }, + { + "path": "config/alerts/default-rules.example.json", + "bytes": 4546, + "sha256": "2a7882f4858cf00f9283daafaf55e1c4f4a20eb23fc4db7586fe85642592c51c" + }, + { + "path": "config/dashboards/default-overview.example.json", + "bytes": 7114, + "sha256": "c1b91a9e24f8b3d1eb70becf22daa7390682dfaf020543df0b8f6e6289c88ed7" + }, + { + "path": "config/metrics/catalog.example.json", + "bytes": 10368, + "sha256": "e0789df49da3759ba74c3bc2335e4a28017bd67005a1b29537785fcfedd543ed" + }, + { + "path": "config/probes/probe.example.json", + "bytes": 484, + "sha256": "8ee10fb81072fb4980c262d0f51a931d70d86763e1d9e3e0f6fbcc90d8822553" + }, + { + "path": "config/README.md", + "bytes": 1085, + "sha256": "9985faa80d7c5d8fc649b59d5bd41f3b79a81eebb07b8d272ad962aa9d2ef5bc" + }, + { + "path": "CONTRIBUTING.md", + "bytes": 1330, + "sha256": "fea964bd6d6b05fa9b279a1930d7c13f66239868046b68aa2ee7726c166d2b5c" + }, + { + "path": "deploy/agent.Dockerfile", + "bytes": 1344, + "sha256": "d8db87a26fe74156f87e97699b60e5bcb9a3fa2db0198bd424520b8decac6624" + }, + { + "path": "deploy/api.Dockerfile", + "bytes": 1086, + "sha256": "e4f2ab4c0053476fe910d35edd074c93d54d86f093eaba2224c1119850b2c333" + }, + { + "path": "deploy/compose.dev.yaml", + "bytes": 415, + "sha256": "4a704c51f0ec1cf343dc2c564c34ab4accbe63dcbf4fb0cab82a78aebe9b180a" + }, + { + "path": "deploy/compose.prod.yaml", + "bytes": 3447, + "sha256": "bb4a931e9c139c3e812221722f93a7f5d92ee279bc35b65f678bc8184d6044cc" + }, + { + "path": "deploy/compose.real-source-smoke.yaml", + "bytes": 491, + "sha256": "6ffc3990985ac1138d164c807a4e749fa8dc0ed7afb33d60133e1caaf68773b4" + }, + { + "path": "deploy/compose.server-smoke.yaml", + "bytes": 852, + "sha256": "d18ab917ce52b35aef99deda3418fa34b46391e562d3f97b5154de1b9ed69369" + }, + { + "path": "deploy/compose.smoke.yaml", + "bytes": 1339, + "sha256": "e29012f4d41104203b4c5202c2a2be1ffea5596e6618c4b43bbe8c98098508e4" + }, + { + "path": "deploy/compose.yaml", + "bytes": 13337, + "sha256": "334cb58d78b9377e27bea0fba0593f810e16c2bc515ecc833c1bc09058c95bd9" + }, + { + "path": "deploy/healthcheck-heartbeat.sh", + "bytes": 2482, + "sha256": "6c47247f12539c2c50ebdde6bb1d4a8e2a17a121accaf7b0f2b41a93a6b38fa7" + }, + { + "path": "deploy/IMAGE_DIGESTS.md", + "bytes": 3669, + "sha256": "a2fc0fbd1adaa641741e4e67ac99e330637407c03c57aa516a2844e1f7bf59de" + }, + { + "path": "deploy/migrate.Dockerfile", + "bytes": 749, + "sha256": "8e3a5125860b0b9f5e0a9e7fadcf783e2d79146252de6f4a96fa1c7ca50130b7" + }, + { + "path": "deploy/nginx.conf", + "bytes": 3904, + "sha256": "5ea25697fe7fe1b44c3a7e5a575b87a72dc3c735ea6e7f6d95ac6e572255678d" + }, + { + "path": "deploy/postgres.Dockerfile", + "bytes": 1352, + "sha256": "358f32c09c26d9b6be286ca94a07fd6a8d9724cbc8ecc2c4ef91610d995f0b53" + }, + { + "path": "deploy/pulse-entrypoint.sh", + "bytes": 773, + "sha256": "d6834de2c7c10cfe70814b8d442bd211cb49bd678343cd6cc36a26ac4a794f50" + }, + { + "path": "deploy/smoke-fixture.Dockerfile", + "bytes": 625, + "sha256": "ffc0fa2d65d1bf1820a8fb213eada23be50d5bed1f193b06ddfd19450b684dc9" + }, + { + "path": "deploy/verify-image-digests.sh", + "bytes": 3266, + "sha256": "975d25044d997c3ccff7ec6594b5bd8acd26003381f7645af5696739a3542979" + }, + { + "path": "deploy/web.Dockerfile", + "bytes": 1021, + "sha256": "541d964882e5f4491e1206d0d21f472d0b1f756e0dd9fcb5f54e461a4d070845" + }, + { + "path": "deploy/worker.Dockerfile", + "bytes": 1090, + "sha256": "ffc8b886479b47fc3018c9468923231506567c0dcb118dcf662e11a2ec7acd91" + }, + { + "path": "docs/architecture/adr/0001-read-only-v1.md", + "bytes": 756, + "sha256": "4d8ba81a916b92c13a75e95b2221ec7dddce335a0e77b07016255a1d96b645d5" + }, + { + "path": "docs/architecture/adr/0002-go-react-stack.md", + "bytes": 837, + "sha256": "3c09535295360054ff7164fcccd64f8cd4aadad10ca11e620e98cb26da43a5a2" + }, + { + "path": "docs/architecture/adr/0003-prometheus-v1-history.md", + "bytes": 695, + "sha256": "67b83b2d387c40810d1302a0590401d148921fb483fec35d6d3480b9160e57c3" + }, + { + "path": "docs/architecture/adr/0004-postgresql-domain-state.md", + "bytes": 559, + "sha256": "1dc6871cba7e50d2c5bd34428f1a08a7ddebad1a9c57fa9778864f09635479e8" + }, + { + "path": "docs/architecture/adr/0005-docker-access-boundary.md", + "bytes": 630, + "sha256": "e2cd0a7dea18452244106dc1537a6935d1d6eaefedef1fcaba70123b2a6f137d" + }, + { + "path": "docs/architecture/adr/0006-rest-websocket.md", + "bytes": 547, + "sha256": "945d06d1350f0e1759fc7d24b0aecf0a0615d793cc4cfe7505e858711c1e81f8" + }, + { + "path": "docs/architecture/adr/0007-localization.md", + "bytes": 552, + "sha256": "04fa52d0f021f233df5277460c74dc3ac51f7256b5d46c69f44c587aff164e28" + }, + { + "path": "docs/architecture/adr/0008-stale-is-unknown.md", + "bytes": 519, + "sha256": "eaee0b68359130757770fef08c83d035fa54f0813cf18e3a3956b15cc72a9dd2" + }, + { + "path": "docs/architecture/adr/0009-upstream-dependency-baseline.md", + "bytes": 4394, + "sha256": "6b8f30f2b511e5005bf5bf713c71462246985664eebc938c030d35f598d24393" + }, + { + "path": "docs/architecture/ALERTING_AND_INCIDENTS.md", + "bytes": 9069, + "sha256": "a47641d3447c6e8fd4d54fba9add13c6107e4d1eadfb33605aa9f6250c451985" + }, + { + "path": "docs/architecture/API_CONTRACT.md", + "bytes": 33239, + "sha256": "10165dd3ebe6506aa02326c5b03852a37d3551ff3b0a294df8191399064af086" + }, + { + "path": "docs/architecture/DATA_MODEL.md", + "bytes": 15031, + "sha256": "de335d2842e583022104f80592d994bbcc8f096e72536253bb4503f21fc2eb3b" + }, + { + "path": "docs/architecture/SECURITY_THREAT_MODEL.md", + "bytes": 8672, + "sha256": "50ce610636f00b2d757f4b50cc65f6bc863f3d6abd2bf9580a9d27faf6b7ecfa" + }, + { + "path": "docs/architecture/SYSTEM_ARCHITECTURE.md", + "bytes": 7162, + "sha256": "2069d35e0c0998aae4867348f54217ead2651f09e0dab65ee0ad4b35a444dd74" + }, + { + "path": "docs/architecture/TELEMETRY_AND_QUERY_ENGINE.md", + "bytes": 5625, + "sha256": "ca558a5726f7b1fd5464cb3c008356a53250b6c5b4b255e89fee09df8d281fbc" + }, + { + "path": "docs/engineering/BACKEND_STANDARDS.md", + "bytes": 2504, + "sha256": "ef09e26713e25b1c67ca55c016db44a0131a0f9b6c05c752044b5aa739f39762" + }, + { + "path": "docs/engineering/CI_PIPELINE.md", + "bytes": 1656, + "sha256": "469bd5db88792cd21debdafcd860a07478dad40b6d281720082c907b89cdd461" + }, + { + "path": "docs/engineering/DEPENDENCIES.md", + "bytes": 3730, + "sha256": "45f0a7f855f8c943943f6566f1881e2f6c43a1ba0fd972fa189068c8ac7df23e" + }, + { + "path": "docs/engineering/DEPENDENCY_POLICY.md", + "bytes": 2482, + "sha256": "5e94b22fde0c14ad2e3cbbae7eab770156bdc8bad78d3196e7bc5d33cfe06743" + }, + { + "path": "docs/engineering/ENGINEERING_STANDARDS.md", + "bytes": 3606, + "sha256": "408bb0dc0ce5411b735a4358266e6bc6eb0b24272afa884973fa2f83f9fed9a2" + }, + { + "path": "docs/engineering/FRONTEND_STANDARDS.md", + "bytes": 2566, + "sha256": "8b2ebdb80eb91a85921f75505abca0c3690424f2972ae1aa012ea9d4a6ca4040" + }, + { + "path": "docs/engineering/PERFORMANCE_BUDGETS.md", + "bytes": 2442, + "sha256": "7f6dd241b8025fcec6556bb05d796b222d5e88489a6761599b3d83c041c734e8" + }, + { + "path": "docs/engineering/QUALITY_GATES.md", + "bytes": 3798, + "sha256": "201baabdf290eb1ba97788929c59c1dadba2f0b6539389a10520c634702d7156" + }, + { + "path": "docs/engineering/TEST_STRATEGY.md", + "bytes": 3909, + "sha256": "48aacf38fb6236e29a311e9a42027ed70e410d8dae62caba2c6f67a34520afa3" + }, + { + "path": "docs/operations/BACKUP_RESTORE.md", + "bytes": 5981, + "sha256": "666705fe5abbb238a1a8da18ca3b6b36e879fb612b63b0afcb45d0d3fff5c855" + }, + { + "path": "docs/operations/DEVELOPMENT_SETUP.md", + "bytes": 1815, + "sha256": "854a4e0345014283d8a786c8cfdd622c4e92f271e5edbd68b07c185bccfdc002" + }, + { + "path": "docs/operations/OBSERVABILITY_OF_PULSE.md", + "bytes": 3228, + "sha256": "dbc086d26ec50e54d360e4b880524998c5473f08b2c183417514a280d4265f26" + }, + { + "path": "docs/operations/WORKER_AGENT_HEALTHCHECK_CONTRACT.md", + "bytes": 7159, + "sha256": "11e3e30384e3fa44d40311f46ed30dd535e240595142d089ae7dc66773c808f9" + }, + { + "path": "docs/product/MONITORING_REQUIREMENTS.md", + "bytes": 4038, + "sha256": "15400f267e1b846a85f7da221363e3915e6a1ff205d6c9cb84703a7f10246cad" + }, + { + "path": "docs/product/PRODUCT_REQUIREMENTS.md", + "bytes": 7918, + "sha256": "2f16d85e72290baa1da8ed5e65d2a269db00309dfa6147eb7b748b79d817b328" + }, + { + "path": "docs/product/REQUIREMENTS_INDEX.md", + "bytes": 5425, + "sha256": "0ab6914f71091f63004f3e5b95da3147e868e7f8fed03721ea568705da8988de" + }, + { + "path": "docs/product/SERVICE_MONITORING.md", + "bytes": 2039, + "sha256": "e16f285b85338edf5f2b2720f6e7e47d2c4bd719b51abc8a82fee6daa0a201d2" + }, + { + "path": "docs/product/STORAGE_MONITORING.md", + "bytes": 2768, + "sha256": "a3a3403b7ff3939214d16bc14e60abb4e74025807e87f1bb6ba71c35b5fc33d0" + }, + { + "path": "docs/product/UX_SPEC.md", + "bytes": 5403, + "sha256": "a2d598fbf6ce0b032f620afb1b9757ca73c326afde9b808d426c43b498907d89" + }, + { + "path": "docs/product/WIDGET_CATALOG.md", + "bytes": 3273, + "sha256": "11f19c1ecb2a09864b683088d61d1156f3cfae0a2e6432485c8398eed7376f53" + }, + { + "path": "docs/PUBLIC_DEPLOYMENT.md", + "bytes": 2608, + "sha256": "b68cd80f64ba497f14a333a21a9c82e22d334cb92afe0bf76c09572664a1db3a" + }, + { + "path": "docs/PUBLIC_SOURCE_BOUNDARY.md", + "bytes": 1681, + "sha256": "8f71df117b9437a5b1dd3a8c2c1f4d2f2f751a23312888230d8f1d3c4ce36de3" + }, + { + "path": "docs/REPOSITORY_BOUNDARY.md", + "bytes": 1281, + "sha256": "3f19cef17b3502aba8cd8f89be329123fa66da2240346f548fc01bfd8d355b11" + }, + { + "path": "fixtures/README.md", + "bytes": 770, + "sha256": "f81fc12566a8260bca8e27e2cdc2349872ecaf58faa674c5e517270d6f3ac09e" + }, + { + "path": "fixtures/scenarios/array-degraded.json", + "bytes": 807, + "sha256": "212e8d322c69361062f5fcd9b2bcf414637de2ff55719909765d5b38119a93ee" + }, + { + "path": "fixtures/scenarios/capacity-forecast.json", + "bytes": 1194, + "sha256": "62bc833e474069483c4152ba70cad893cd4b1a4eaa82558198d5dee884302dc6" + }, + { + "path": "fixtures/scenarios/container-restart-loop.json", + "bytes": 1517, + "sha256": "e67c7ebf5b4f2e559af7291aa8b2ee1a56c1051e2d8a2a79f67d74cf0fe96e2c" + }, + { + "path": "fixtures/scenarios/database-restart.json", + "bytes": 815, + "sha256": "af57feb59edb827e543b910d77df75b2e1a6c4086d27da813025550cdb962c24" + }, + { + "path": "fixtures/scenarios/disk-temperature.json", + "bytes": 1396, + "sha256": "cb58c475efe31523910b9c2cfdfcb4bce6c76e54bc861fae66c8b0ab087c3e89" + }, + { + "path": "fixtures/scenarios/dns-outage-suppression.json", + "bytes": 975, + "sha256": "60478a6021d3f6efb8bca686e6d565db81dade0b8a6dfc45525f16f2f4c4a5d0" + }, + { + "path": "fixtures/scenarios/healthy-baseline.json", + "bytes": 1307, + "sha256": "7adc54da8f6ecb5b071c0e9f26e779628267a8044a413a7470827902e1d3e385" + }, + { + "path": "fixtures/scenarios/pool-capacity-pressure.json", + "bytes": 973, + "sha256": "56247c3d884bfc01abc6bea03d06d1dcced6f9503ff487097a72fd0cbd2cc3ca" + }, + { + "path": "fixtures/scenarios/pool-degraded-scrub.json", + "bytes": 873, + "sha256": "f1fa684bc319c758763e8ba703e99563c1b6c6b2e199d4c3cbf58f54c09d0b9f" + }, + { + "path": "fixtures/scenarios/probe-executor-cases.json", + "bytes": 2105, + "sha256": "b63558f5174ab5dbb90ca14a88a222065a5dbbd97ba736852368d92e4cdb3749" + }, + { + "path": "fixtures/scenarios/probe-scale-300.json", + "bytes": 929, + "sha256": "a73e8906b9980a8e59eef189a64f3167aaded63168cb250c24f9a6cb4e7c6327" + }, + { + "path": "fixtures/scenarios/prometheus-stale.json", + "bytes": 1153, + "sha256": "46a0d0c4a5eca9db6288bd9064438d341ba9a42466a6985863094eb7947faab9" + }, + { + "path": "fixtures/scenarios/service-down-container-running.json", + "bytes": 1230, + "sha256": "2a05a37186f9adca8c6216cb11e20c5c75e57ad70ba605204cb73d41048d86bf" + }, + { + "path": "fixtures/scenarios/share-growth.json", + "bytes": 811, + "sha256": "7eff0c41976c016d7c03541d40e75ebd5861f420905b94d3d8e87e287c89e43e" + }, + { + "path": "fixtures/scenarios/smart-warning.json", + "bytes": 867, + "sha256": "f01003c4d4d0131979546ef169d490c4cef194cb1364139032f8b136cd029607" + }, + { + "path": "fixtures/scenarios/storage-map-heatmap.json", + "bytes": 710, + "sha256": "81590e9d870524b5c4ed9fa79d89001467fa69b0bd5582ec72c5f850cee07677" + }, + { + "path": "fixtures/scenarios/ups-on-battery.json", + "bytes": 1137, + "sha256": "0acb36fbc27f00243cf9cafb0adcff567fbdbfaa10d7987e4d41af66831975dd" + }, + { + "path": "fixtures/scenarios/websocket-slow-client.json", + "bytes": 981, + "sha256": "8f78f20005eca3d3d75f4711821eaea50bd7789fabe6317adbf3a4dd1fa551d8" + }, + { + "path": "go.mod", + "bytes": 506, + "sha256": "9b66d78faafa917cb8f0059367d87893063110cda9d67fa5ec3b611a8e416f23" + }, + { + "path": "go.sum", + "bytes": 2987, + "sha256": "965ee81707030d0e9e3acb9d500a6718c0cd84bb0b5337375126a1795a26d57b" + }, + { + "path": "go.work", + "bytes": 17, + "sha256": "124e5e32560767b76985cea233ce8d28940328baffe11bbfe474365b3da0f57a" + }, + { + "path": "go.work.sum", + "bytes": 607, + "sha256": "29b62358e0a01cff2628bb03a17ae743826ff3508575cd3b4c59b65de3ddd70b" + }, + { + "path": "internal/agentprotocol/protocol_test.go", + "bytes": 397, + "sha256": "035e818888fb7e6d0dfbf66a575352181a1bc3864ab2c3f07a4e5a239713c068" + }, + { + "path": "internal/agentprotocol/protocol.go", + "bytes": 1105, + "sha256": "6cac1ff17ab279d544782a030870da888cafd869b445573da852674bde8ae95d" + }, + { + "path": "internal/agentsource/agentsource.go", + "bytes": 10643, + "sha256": "9c8168a3ebeb71278fd53d0d72899c8e2c62d36ee3081d8410cf14b7e48d33cb" + }, + { + "path": "internal/agentsource/application_test.go", + "bytes": 9191, + "sha256": "c58573cb635b362f5206a078028b891d2fd26697e36de4cdf1554aa588696173" + }, + { + "path": "internal/agentsource/application.go", + "bytes": 7730, + "sha256": "653ad730e585a17f4c8924fdbf94f7154bfb4aa60a0d391e0f7dfdf361050cb6" + }, + { + "path": "internal/agentsource/health_test.go", + "bytes": 2431, + "sha256": "7029155737e4190b312a06153f6faebdef72a76dfd2e39290b87fbb92a21f51a" + }, + { + "path": "internal/agentsource/providers_test.go", + "bytes": 16435, + "sha256": "9678849fa8684589b32c3f8de5bfcbb50247c4dda0e0a0a45a0171c95acce47e" + }, + { + "path": "internal/agentsource/providers.go", + "bytes": 6882, + "sha256": "bf0680a5fd2645f51f51b9612b9f8d8e99b27f1de56ca73970290848cad2fead" + }, + { + "path": "internal/agentstore/contract.go", + "bytes": 4231, + "sha256": "a2bbd3ccd79513ef8cdd073c8b8c455581412bba1114e7095701f53888116585" + }, + { + "path": "internal/agentstore/postgres_integration_test.go", + "bytes": 4213, + "sha256": "c0d6eb9391ece2325b2648c87289a73822ab4c3e258f1617247d7ace9f43011c" + }, + { + "path": "internal/agentstore/postgres_test.go", + "bytes": 8851, + "sha256": "4de66c1818dee7f126a404ff63fd2f2fe226f03b9e8762aa062e5bbf702a3c48" + }, + { + "path": "internal/agentstore/postgres.go", + "bytes": 9673, + "sha256": "2af188503febaff1cb9db63afef0a0963820d3fdef946f790dcc8211b523a089" + }, + { + "path": "internal/alert/alerts.go", + "bytes": 4415, + "sha256": "a1e3b823f9a447f2d660a311254e677d8fe4970fe218a990162f454bf7cd7d64" + }, + { + "path": "internal/alert/grouping_test.go", + "bytes": 4128, + "sha256": "b72ec739f59c07e3ccd6136742c198c238d4ee9b33ebe2332449bd25394b6f20" + }, + { + "path": "internal/alert/grouping.go", + "bytes": 7373, + "sha256": "e3d277f5328b8e5af4f3ce874341a1a235ed6c79af9a386a42dbd48f084734bc" + }, + { + "path": "internal/alert/operations_integration_test.go", + "bytes": 3060, + "sha256": "7a0f1b9382c6c93bd295ca2460f915f52b8f3d488d8ef1b8a5217d016de3731b" + }, + { + "path": "internal/alert/operations_test.go", + "bytes": 940, + "sha256": "72122b9472960a5f78d64e2e6259efe9f4e5b766ed375d50f8ebc2c69e43ac4f" + }, + { + "path": "internal/alert/operations.go", + "bytes": 5209, + "sha256": "dbad92ec908067830750cfd8e87539734421f150c8b7ecae7202335aaf8f3720" + }, + { + "path": "internal/alert/repository_integration_test.go", + "bytes": 2652, + "sha256": "b12250f8ce2865990e59d7dbd79870cbe47b7ab5e97c8d35adf9a113d98acb4a" + }, + { + "path": "internal/alert/repository.go", + "bytes": 15627, + "sha256": "548c56161276c8310bb71ec8c8346c41d06bdd5ca10610a2741b1562889b4e8f" + }, + { + "path": "internal/alert/state_repository_integration_test.go", + "bytes": 6443, + "sha256": "846032736e0112b59820d58355c8c7104eabedda724eb96cbf551402f3d1393f" + }, + { + "path": "internal/alert/state_repository.go", + "bytes": 17249, + "sha256": "d35351f7e695e682061699395688990843379e4faf06b62ab70bb691f720385a" + }, + { + "path": "internal/alert/state_test.go", + "bytes": 8014, + "sha256": "26199d6e811a0a561429a1d59830c87a6bfa2201972baf0ab4bfa77cbc43ecc4" + }, + { + "path": "internal/alert/state.go", + "bytes": 7471, + "sha256": "2edf81188182139b25afd1c6b4f5bc0d72b1ee9cb39e949cf0931a9f1e996302" + }, + { + "path": "internal/alert/types_test.go", + "bytes": 3420, + "sha256": "61c5e6936063fcadd53f371864cecf095daedf120f9da4c058b017680440e62f" + }, + { + "path": "internal/alert/types.go", + "bytes": 13854, + "sha256": "16d31ce4964ed40078856681568eb77161569c4e28877211f8a099d79a9b1221" + }, + { + "path": "internal/alertapi/handler_test.go", + "bytes": 4862, + "sha256": "e496438b2ba386c1d8f8d851e387cc715a6ceb1a0fbd60439587325ae3c3e88c" + }, + { + "path": "internal/alertapi/handler.go", + "bytes": 9817, + "sha256": "3bda485172e8839096f27b0b6f3a26a1b90442df9c1bbaa9949df86dafe1b608" + }, + { + "path": "internal/alertcontrol/expiry.go", + "bytes": 281, + "sha256": "b289faa229b870efef262cead51a796fc7cd9833186381a06719cd0b82628e1f" + }, + { + "path": "internal/alertcontrol/repository_test.go", + "bytes": 4243, + "sha256": "4979c24ea42a0a1b5567321d1303d30c0b3c002fd35ad3ec310c15a026226005" + }, + { + "path": "internal/alertcontrol/repository.go", + "bytes": 12742, + "sha256": "edce75bc98f081eb9278bd3c656505be094dfa716c250ebd642f68df55f4183a" + }, + { + "path": "internal/alertcontrol/runner.go", + "bytes": 505, + "sha256": "16e42c75ba34e791d545e906489d5230e8c9e09dea84e2a0e017bc12aad6274a" + }, + { + "path": "internal/alertcontrol/types_benchmark_test.go", + "bytes": 533, + "sha256": "a1b6bdebc1d0cd7c686e1d9f2417ac47a7575ce469e47b56d470fe83502dc0f7" + }, + { + "path": "internal/alertcontrol/types_test.go", + "bytes": 2116, + "sha256": "9c4eb4b7919e65f752f8e4753dba9db42a7c4f9c366d74872e7bb239f59b6823" + }, + { + "path": "internal/alertcontrol/types.go", + "bytes": 7532, + "sha256": "ddef3a6aaa8dcd5686c67eba3a8a554a24461a0eb200fbdfd82fea185b44b9e7" + }, + { + "path": "internal/alertcontrolapi/handler_test.go", + "bytes": 7807, + "sha256": "7b17156c9683f1c06777b92c1fb3fd57be855905814160aa8129a6833a4a26d2" + }, + { + "path": "internal/alertcontrolapi/handler.go", + "bytes": 8832, + "sha256": "50cf2efa4b62c5e7ddb7ab2efbb3732cfcd7ed2b3c0ba2a37808c339c00e96bc" + }, + { + "path": "internal/alertdefaults/seed_integration_test.go", + "bytes": 1489, + "sha256": "8575ea10942081ed5efd056dd0cb66c822cb94cea56e6418ebef178baf226657" + }, + { + "path": "internal/alertdefaults/seed_test.go", + "bytes": 5662, + "sha256": "00fd1e63c049fd7dfbc5307453c7fd0c98a3dd180e3c9c21d1cb75c78fb25a3e" + }, + { + "path": "internal/alertdefaults/seed.go", + "bytes": 3833, + "sha256": "9437c591ea63909f83b1014ba850c19c65ad2b4fde56e4a65abf24c5362ff57a" + }, + { + "path": "internal/alertdefaults/seed.json", + "bytes": 4538, + "sha256": "ec609aee4344b1792ad86ce850d4543dcea2a650ac1d47f53d2d5cddfa6779c1" + }, + { + "path": "internal/alertopsapi/handler_test.go", + "bytes": 5915, + "sha256": "1d642b833d91efea919cf026b96cc4dfd8ac3125e45ac29627b0db979179cde6" + }, + { + "path": "internal/alertopsapi/handler.go", + "bytes": 6974, + "sha256": "f6f8696c9f3ca5b5d20768de1ea05b332edeff2ad6cfaf4dc8a27e3e541550b5" + }, + { + "path": "internal/alertworker/memory_store.go", + "bytes": 1871, + "sha256": "43d1174561e5ae636b7c55572faf08769891940d6a477a214cd78632d3c1b7c9" + }, + { + "path": "internal/alertworker/postgres_store_integration_test.go", + "bytes": 2093, + "sha256": "698ade7483f256ced9cf33e2ca1487a6a8914464da6e3ea910b15d5486eb7ff0" + }, + { + "path": "internal/alertworker/postgres_store.go", + "bytes": 3695, + "sha256": "1ff95438299be2d23189650dee174fcf44f25c10d39488f0580cb3341eba2593" + }, + { + "path": "internal/alertworker/worker_test.go", + "bytes": 6554, + "sha256": "f7a94ec064280af27634ca9b0bc79bfb74fc650526646fc534173ebce11714ff" + }, + { + "path": "internal/alertworker/worker.go", + "bytes": 7153, + "sha256": "14d6d275f5d1953345ab613c1192111b375dd041fc657f2a18f84383af8b8b6b" + }, + { + "path": "internal/application/types_test.go", + "bytes": 3812, + "sha256": "df38310c0a8170d287a8cf1b77d92fe48bb2760f57268c383e021aed25380cec" + }, + { + "path": "internal/application/types.go", + "bytes": 8401, + "sha256": "b7b2ff866d510b8ac1da26b2d78dc63d63cad834faba21e63f0bb7e29b56d105" + }, + { + "path": "internal/applicationapi/handler_test.go", + "bytes": 1904, + "sha256": "284fef347d6b66c8df919563a2533db3d37b19c4247846c3f5e668545bb3818a" + }, + { + "path": "internal/applicationapi/handler.go", + "bytes": 2125, + "sha256": "a3f31e56d4a056f45bce0f303c2d8b39e21c10c99047edd9cffe34b5884ce923" + }, + { + "path": "internal/array/types_test.go", + "bytes": 5202, + "sha256": "adc5965083129bca34c81b3cc4862ff30e16d27a93bbbef0cb7f7ec9b79ac0cf" + }, + { + "path": "internal/array/types.go", + "bytes": 12386, + "sha256": "725ab67c4c6a4fb31e08a2dd1fa2e7650613b58aefa9f54128821606763efc3d" + }, + { + "path": "internal/arrayapi/handler_test.go", + "bytes": 2508, + "sha256": "2ebef48705767589cba2a3500273e7368d893c47b3c7cf02988f2a075092a1e4" + }, + { + "path": "internal/arrayapi/handler.go", + "bytes": 1550, + "sha256": "1d519ecce622275ca53c4d641e74aa8296518a7cd685cec18f04e7c6403cf6db" + }, + { + "path": "internal/audit/audit_test.go", + "bytes": 592, + "sha256": "f3a0c0065605b3bbc0b77ee2022e8cc6d1f98d619e54f3c1c6304a86acc13525" + }, + { + "path": "internal/audit/audit.go", + "bytes": 2352, + "sha256": "127c7dcd2a1491061023ab3d1555902e50e1c57339b23f82505ea4d27865cc30" + }, + { + "path": "internal/auth/oidc_test.go", + "bytes": 7869, + "sha256": "dc9dfc579d82f3a47b829da283f0bfdefd10e191d17c28a6e95c10c3af33315b" + }, + { + "path": "internal/auth/oidc.go", + "bytes": 8839, + "sha256": "c2476ab438aee6ab910988b29e27034fdf0d4b3a5526d6f210c35af152cbe807" + }, + { + "path": "internal/auth/session_test.go", + "bytes": 7353, + "sha256": "7834d3431ea3f5556beb3ba4ce49f521401147b90a4f75946b282b9cb7aa6a76" + }, + { + "path": "internal/auth/session.go", + "bytes": 7234, + "sha256": "eaabc3cbeca70b41c885083fdf23b895033c596378a0ea8db3732d841c2fa9e7" + }, + { + "path": "internal/authapi/fakeidp_test.go", + "bytes": 4802, + "sha256": "6c09b839ee07fa1bf744d01a2cd9870c327bea46e779002db4f0d6f3482d2bca" + }, + { + "path": "internal/authapi/flowstore_test.go", + "bytes": 3829, + "sha256": "00a30f19961f7974a258f689d9d0997076b1352420bb3d48afaac35efa892ebf" + }, + { + "path": "internal/authapi/flowstore.go", + "bytes": 2860, + "sha256": "3c78819dbf990d7dabd6b9db8273ae0b403fe72cfd6f0a1d487e895aef7428c8" + }, + { + "path": "internal/authapi/handler_test.go", + "bytes": 21169, + "sha256": "b5e68c765e025b8fb2b8284b19e0486a785524b424419dc87696a4acd766d161" + }, + { + "path": "internal/authapi/handler.go", + "bytes": 13401, + "sha256": "bd382b9e36d36c1c27ff34090a7a05b16fa220c734803f393638989616707994" + }, + { + "path": "internal/authapi/wiring_test.go", + "bytes": 2483, + "sha256": "4d9383bda2a487e1256182047a128963cf6a52b52b91d153929a4bac0c8213a8" + }, + { + "path": "internal/backup/manager_integration_test.go", + "bytes": 9764, + "sha256": "a21b5bfc1aa2be578dd3e656baa225069f1ccb761c801722c556fb68bc0618af" + }, + { + "path": "internal/backup/manager_test.go", + "bytes": 2319, + "sha256": "21047f8e39fa45f0e598a8e431e75556430ba8101b9506317dbda851fe186a82" + }, + { + "path": "internal/backup/manager.go", + "bytes": 26981, + "sha256": "dc4e00a71a85ddd87d82d07a1b2feb1dcf6b3a5aefb0c1592dac093bb4f3a974" + }, + { + "path": "internal/backupapi/handler_test.go", + "bytes": 1509, + "sha256": "c4776b174e1676c08380240e8409b4149e58b04bcfea0aaf060c9d4d127bd8db" + }, + { + "path": "internal/backupapi/handler.go", + "bytes": 2890, + "sha256": "71db8b51b112d2ac99896d3ff5ba58fa9d0d86212601d3417506be3531072883" + }, + { + "path": "internal/buildinfo/buildinfo_test.go", + "bytes": 560, + "sha256": "41cd5138733cd3c8426f4825a538e6331b353e39329514908b4787c59f11a5dc" + }, + { + "path": "internal/buildinfo/buildinfo.go", + "bytes": 341, + "sha256": "a2ecfa288b1a896b58fe8e7998f4ac8e7f1a642d6e987ea81e7f441e9054298f" + }, + { + "path": "internal/config/config_test.go", + "bytes": 10668, + "sha256": "1b860db011d0ff27db355e846ff3ffd4071fcd173175089a89bb97c1c6c2ef1c" + }, + { + "path": "internal/config/config.go", + "bytes": 18200, + "sha256": "cdeede7f50f82c06e2f605d33d607c8bb23e9132aab787fc62adcc34149010c8" + }, + { + "path": "internal/container/types_test.go", + "bytes": 5297, + "sha256": "31f7bab1a770e01183ac1d99f029696a65ad38c3ff99cd4ab0637f23ad42b816" + }, + { + "path": "internal/container/types.go", + "bytes": 11494, + "sha256": "bcc8abd6791af9e0ea5435fe83451f892e4e35d6d2a1af44c327237fdaf6d553" + }, + { + "path": "internal/containerapi/handler_test.go", + "bytes": 2709, + "sha256": "b479aef93eb912076607c6e492ef8aa62b66a1298de055c3362e66133bce4f1a" + }, + { + "path": "internal/containerapi/handler.go", + "bytes": 2754, + "sha256": "eee671b0c1cb70dac11003cb6ab2517218d3e941f3acb72e81dfca27b09dbc9f" + }, + { + "path": "internal/correlation/correlation_test.go", + "bytes": 1401, + "sha256": "5e8881dc2261dc250184f403d1f7e1591adea072b168252568e313daa1ccc2a9" + }, + { + "path": "internal/correlation/correlation.go", + "bytes": 961, + "sha256": "dd350b66503a8dba60e1a9adada723c64b75a5a165da181f88e6338e91539f5d" + }, + { + "path": "internal/dashboard/document_test.go", + "bytes": 1018, + "sha256": "33aef9e42b10f9e304674c998bfa0df2fb7edbd2dfe20effd5592a2c1c498f23" + }, + { + "path": "internal/dashboard/document.go", + "bytes": 2385, + "sha256": "67e80391c5164796c2b025f92073cce47acf3dfd15b93ba826318c205c106794" + }, + { + "path": "internal/dashboard/errors.go", + "bytes": 235, + "sha256": "561e6c905899db27392bda0dd653139ba84d53028dc374291a470bfc80a9282b" + }, + { + "path": "internal/dashboard/immutability_integration_test.go", + "bytes": 1410, + "sha256": "d6c8f927cadbfc830a148999089eb638797a655742c181f480a3a34ceb50ac38" + }, + { + "path": "internal/dashboard/repository_integration_test.go", + "bytes": 4462, + "sha256": "0941e82a07423809fe0c451131bbefa44c277400a3e7f62ecc61a0758af96231" + }, + { + "path": "internal/dashboard/repository_scale_integration_test.go", + "bytes": 2029, + "sha256": "51c0cebe72ba62480238dbc2f2eb1082b4852f385ad1c3e880d4e92ed42115eb" + }, + { + "path": "internal/dashboard/repository.go", + "bytes": 12103, + "sha256": "d3ae8c01db9d9c208757a676b766c5b728e47eb1fbde47955de8f24fc7dced13" + }, + { + "path": "internal/dashboard/version.go", + "bytes": 1003, + "sha256": "cb0ae1c5b4405515b714356de4d94cc590cfddbf0561ebe6da9af96bc89f1e4b" + }, + { + "path": "internal/dashboardapi/handler_test.go", + "bytes": 4637, + "sha256": "2f587cdaee71a992fbc31bbe24b911671288630955d01d592c191356b3c85f27" + }, + { + "path": "internal/dashboardapi/handler.go", + "bytes": 13841, + "sha256": "38ebeb019a8191db34f3ee0e78962355473da3460a4a086fa3e24dfc69c0076a" + }, + { + "path": "internal/database/database_test.go", + "bytes": 11769, + "sha256": "1e3f3bf1344619bd625defa941de3ec1b1b43951713940786d36d159c325905e" + }, + { + "path": "internal/database/database.go", + "bytes": 3547, + "sha256": "5e19e4752d1e541cd20708cd162458b9afb3ac0c4e89d049803ebbf13883eb16" + }, + { + "path": "internal/database/migrations/0001_foundation.sql", + "bytes": 5235, + "sha256": "3233b1d7ffa22b392a439ba2413d55784047f1559aa6c7e51e833b399af97e83" + }, + { + "path": "internal/database/migrations/0002_inventory.sql", + "bytes": 1560, + "sha256": "238e4bef09d34a7a0fccda25cdacc05f19ed9559e684c8ee4dfb21df0cdcf24a" + }, + { + "path": "internal/database/migrations/0003_dashboard_immutability.sql", + "bytes": 487, + "sha256": "2aa8bb11d77e70e1d1ebea000070c14c0c6c001cc7048468d4be62d130a78ebf" + }, + { + "path": "internal/database/migrations/0004_dashboard_revision.sql", + "bytes": 503, + "sha256": "82e63ecc307a34ef7e54f21d4ef6cf4be50327616da3cd8317bf6c6fe21e3739" + }, + { + "path": "internal/database/migrations/0005_services_probes.sql", + "bytes": 6201, + "sha256": "986ad715a2f83d571fab2ee7aa9baed790da9b091e691eb65d22d1135c2efb50" + }, + { + "path": "internal/database/migrations/0006_alert_rules.sql", + "bytes": 2151, + "sha256": "de2ede1a6fb68d301fc81d0dd1431b87498d97e154d31ae5c9307f0ac5818630" + }, + { + "path": "internal/database/migrations/0007_alert_evaluator_leases.sql", + "bytes": 229, + "sha256": "e502486b1661943c7400da63b404280141412689235576b411abf6d3f2e0d862" + }, + { + "path": "internal/database/migrations/0008_alert_state.sql", + "bytes": 2418, + "sha256": "05f6e5e336e6506967e9a52350643592cd62d28bd69c79aa43042c4f3c43df9f" + }, + { + "path": "internal/database/migrations/0009_alert_hysteresis.sql", + "bytes": 339, + "sha256": "9bebfde31d6e79531e40e8d74457286e0e7521646cac66f6793dcb4e93630d80" + }, + { + "path": "internal/database/migrations/0010_alert_controls.sql", + "bytes": 2377, + "sha256": "d68108ebec12a8545b655fdec7d2c6487f713d2f3b5d89d144b54fde082c3fc3" + }, + { + "path": "internal/database/migrations/0011_alert_unacknowledge.sql", + "bytes": 394, + "sha256": "5ad63820ddc8673115eb4c8b3068dbad23fe725e485a7b2a38836c09b01b209e" + }, + { + "path": "internal/database/migrations/0012_notifications.sql", + "bytes": 2371, + "sha256": "c4942bb35c07712a38f1839aab59e53b313662549947cf1c24b2fc2927d4aaca" + }, + { + "path": "internal/database/migrations/0013_incidents.sql", + "bytes": 2728, + "sha256": "315daddbc326ca8d77a8b6904d871e11602f3fcbf6db7c042261e4629ea94869" + }, + { + "path": "internal/database/migrations/0014_incident_notes.sql", + "bytes": 421, + "sha256": "10f5bde656ffdde2107bbbe0217ec59b206bd5c014a62c8650205efd14d82b5b" + }, + { + "path": "internal/database/migrations/0015_entity_listing_index.sql", + "bytes": 97, + "sha256": "acb70c2d43278b3d6084548191e894eed06f9a4c576e55ea10e0c04cc4f4e4c8" + }, + { + "path": "internal/database/migrations/0016_agent_snapshots.sql", + "bytes": 1188, + "sha256": "890602b4bf713e356349f002e116f3c8fd3e78328de1ee3916602c6e78dcf070" + }, + { + "path": "internal/database/migrations/0017_worker_runtime.sql", + "bytes": 2285, + "sha256": "99ad0d9468bdc124002c239903de47bed5ba5badd10781ea898a4dc4d2ea8110" + }, + { + "path": "internal/database/migrations/0018_inventory_read_indexes.sql", + "bytes": 685, + "sha256": "877b87361e73bfc46fa057e10d17b6357308f775edc6bfa532c09600125980c6" + }, + { + "path": "internal/database/migrations/0019_capacity_samples.sql", + "bytes": 707, + "sha256": "00b5d3029c7985920b14191cab1ce1d93ba97ab2c990fcf694f0818de6a323d2" + }, + { + "path": "internal/database/migrations/0020_service_certificate_history_index.sql", + "bytes": 122, + "sha256": "4aac7a3f09f0db6401f363abff19eb9cc719631738046a38adc3468fc7e238d9" + }, + { + "path": "internal/datasource/contracts_test.go", + "bytes": 2032, + "sha256": "19bc66e6fc4235da3490699a5426306f6330240517a2092ffccbe41ec9900209" + }, + { + "path": "internal/datasource/contracts.go", + "bytes": 5557, + "sha256": "311bd138fa132209ad63f85425d8af70bac6142b0e3ff3b22d7e82c1fd82bf8f" + }, + { + "path": "internal/discovery/jobs_test.go", + "bytes": 1974, + "sha256": "c584ccb6051bad0e5ec863f3fd5ba7f7054ec2673b0a63f2f6f3859631aa2257" + }, + { + "path": "internal/discovery/jobs.go", + "bytes": 4377, + "sha256": "0ea95fcf7dad60bbd4b0b8288d52a53c3d2c5a25ecb2155f8784d7518977c3aa" + }, + { + "path": "internal/discovery/postgres_store_integration_test.go", + "bytes": 3661, + "sha256": "7cb631108e1d3626cf2c6bea0738ed24240387b3a7a4d3f5aebd2f7311074858" + }, + { + "path": "internal/discovery/postgres_store.go", + "bytes": 11910, + "sha256": "58b45e66bd0781f651e60e07705498d48e67906248052b8500f2705f339abec5" + }, + { + "path": "internal/disk/performance_test.go", + "bytes": 2297, + "sha256": "79066ab046f7009d9998062e7b32a33a10ce41c9e382e2d3c71f0ccff30ec897" + }, + { + "path": "internal/disk/performance.go", + "bytes": 6388, + "sha256": "e6e2589bae0d40b7b49978a9b6046588741885c2ffab738db4db4d11950f1bb2" + }, + { + "path": "internal/disk/smart_test.go", + "bytes": 2899, + "sha256": "4ef7b6ee12adebb1d0e8a3774889f6ef80419807cbe16d71942d47702dad708a" + }, + { + "path": "internal/disk/smart.go", + "bytes": 5983, + "sha256": "b088433b5825f54487789f10aaeed250347e694c5c69fadd444b9a8bbeb14691" + }, + { + "path": "internal/disk/types_test.go", + "bytes": 5121, + "sha256": "0c1ebefcb59350c9d07be2398f54038e99b72afe93ae749c4d3920657238bff2" + }, + { + "path": "internal/disk/types.go", + "bytes": 13099, + "sha256": "fb9016b856ed751e74e37fb32b586468c267ac834c6cbbeeffeb7ed80ba01e12" + }, + { + "path": "internal/diskapi/handler_test.go", + "bytes": 2127, + "sha256": "2fa83a064a2338fcb869001607621e87a28a5ba500907fb87ddba69f8d101f80" + }, + { + "path": "internal/diskapi/handler.go", + "bytes": 2497, + "sha256": "bfbb212e34935a757e4abc3949306db6ab374b487942c1c63a23aa1d5c05f69a" + }, + { + "path": "internal/eventapi/handler_test.go", + "bytes": 1600, + "sha256": "9726474e31d93d7cfda914b36aefab7ef3205f9545f0d23dab1a0a77456f6cd2" + }, + { + "path": "internal/eventapi/handler.go", + "bytes": 2894, + "sha256": "02e0d8832663b9b13c6679429cb76bb9babd5a97a083cd9dc007e8474a3a8156" + }, + { + "path": "internal/eventapi/postgres_integration_test.go", + "bytes": 2058, + "sha256": "78d51a1e38976a4946ff4324958df684e7117f783feef10ca44327e99dfad8c2" + }, + { + "path": "internal/forecast/storage_integration_test.go", + "bytes": 3183, + "sha256": "3b35adc1537c7b6eb6dae568982ca0ea6e6aacdf3e8d7fe8c12ae2748f84bffc" + }, + { + "path": "internal/forecast/storage_test.go", + "bytes": 4950, + "sha256": "093edeb0f095e1d8c0989b220b0741c59435a911c4bea291021411f4de227954" + }, + { + "path": "internal/forecast/storage.go", + "bytes": 6290, + "sha256": "4427232a168784ff77bad5ab1986b56554fec12177fc2cee82ce166e7a7d5bef" + }, + { + "path": "internal/forecast/types_test.go", + "bytes": 3712, + "sha256": "a333e6e178b66947f3c5cd8bc0cf5e23ace1481f8585daa3185f6553b8d4becb" + }, + { + "path": "internal/forecast/types.go", + "bytes": 8372, + "sha256": "34c747cb68344fcffd6378f59cbbf8a93d4c85b0521d1ccd947683fb0dfa3504" + }, + { + "path": "internal/forecastapi/handler_test.go", + "bytes": 2520, + "sha256": "6b2c776631a7beb31e11ca2a3b0b43860825a779e1bb5ef1fd84edee58cbda67" + }, + { + "path": "internal/forecastapi/handler.go", + "bytes": 1430, + "sha256": "b33fe3c6a9f060f2e41c9607845f3a2fa82850754b9b5ee7b0676ce92f856d7a" + }, + { + "path": "internal/freshness/evaluator_test.go", + "bytes": 1804, + "sha256": "911b9704280ac4697db86629c9ccc004abdba3a286f0fb3872d58908dfb78913" + }, + { + "path": "internal/freshness/evaluator.go", + "bytes": 1342, + "sha256": "b6b930dd973b84f9d190824e94c3b49a1f76e54efea1ec874c4c6d05c534a5f0" + }, + { + "path": "internal/host/adapter.go", + "bytes": 873, + "sha256": "0e5ee1a827ae26132844fece782c29fdd37ae2a24ea9dae274b29e715d1863e5" + }, + { + "path": "internal/host/hardware_test.go", + "bytes": 2685, + "sha256": "d0b12c73547ce1b743f7dd702ab4cef058547570257f8ba4bb9cad94bb42d72d" + }, + { + "path": "internal/host/hardware.go", + "bytes": 10707, + "sha256": "58a19418782a68087c90b57a1505b935919519e65631ee91e3e8304fb7a42f28" + }, + { + "path": "internal/host/types_test.go", + "bytes": 4275, + "sha256": "e6f604c8b9b5125a19b80b7b7eb7afb34c2ff7458354b9904cd13f5ee0686ba7" + }, + { + "path": "internal/host/types.go", + "bytes": 16763, + "sha256": "9b375a29685ae55bcdd444c9832e16eace8b2cc5c218be9013eb80a085447653" + }, + { + "path": "internal/hostapi/handler_test.go", + "bytes": 1953, + "sha256": "132e6daf40fb6c29b8f5dc1b58fc33ea3ef136342d25343f3f3601c0e5488961" + }, + { + "path": "internal/hostapi/handler.go", + "bytes": 1412, + "sha256": "d1fe9399a0004e0f4a40ee05ba9bc2338623aa9a0760a3d55ce44c2618a6054b" + }, + { + "path": "internal/hostcollect/clock_linux.go", + "bytes": 1451, + "sha256": "4780bcc664623fc145d37489ffab180956f714cdc32a8d647fb2f936b07aebe5" + }, + { + "path": "internal/hostcollect/clock_other.go", + "bytes": 346, + "sha256": "7e64527c6c835981cab75f1b45db08cc441e601b3020a75da0209ff38edf87a9" + }, + { + "path": "internal/hostcollect/collector_test.go", + "bytes": 14925, + "sha256": "075f95ce9c85928a5c1fa23f1aa7bd0d6d4e25518a65562276428a22f1b88d75" + }, + { + "path": "internal/hostcollect/collector.go", + "bytes": 12213, + "sha256": "3634f8a3715723074632a052b71dbc5540f120dbc1c741485825b17d4cc9f389" + }, + { + "path": "internal/hostcollect/cpu.go", + "bytes": 4973, + "sha256": "dae0df25c85d32eee7fc9e0d5225bd55e65dc1674c82ae84e1f394412c2c87c2" + }, + { + "path": "internal/hostcollect/errors.go", + "bytes": 365, + "sha256": "43f0f6e97efe60d916abd698bf8d723bfbeae8703d27012c2abb223b56f3aee6" + }, + { + "path": "internal/hostcollect/filesystem.go", + "bytes": 4319, + "sha256": "af20d83cebd614fe058d5d9d98c5bd7bfca95caa9f01ad51fe2e9ce490e85596" + }, + { + "path": "internal/hostcollect/loadavg.go", + "bytes": 1105, + "sha256": "8b62e4d56f4338883ac6a8e7a0a13368673ee2cbd808d6f70e562a7a2acce980" + }, + { + "path": "internal/hostcollect/memory.go", + "bytes": 1930, + "sha256": "13961e06cdfe144f9440c1b869326eaafa353365cdd2c09a4bfa8b24afc5c99e" + }, + { + "path": "internal/hostcollect/network.go", + "bytes": 2772, + "sha256": "7ea9f536f10da3d5023449a292b57104e22c65829a9da770f90318d1614cb9c6" + }, + { + "path": "internal/hostcollect/parse_test.go", + "bytes": 6792, + "sha256": "bc7494b945f608516a47fce06d449e6891674aba4e261b5ee1b4f16f73dd4e44" + }, + { + "path": "internal/hostcollect/process_test.go", + "bytes": 9359, + "sha256": "b3d80fee267b250be3f8c5678ecc108319d53b96b4459f2a4b4460480ac3831b" + }, + { + "path": "internal/hostcollect/process.go", + "bytes": 10464, + "sha256": "0348a78ce53424a0b73dd880247c9d690792ed6393915111f5a0828b87aba5ef" + }, + { + "path": "internal/hostcollect/procfs.go", + "bytes": 1708, + "sha256": "9111539220409e5a757cef22043e3b18fc6ff4692422588c594c6055c6dc9b32" + }, + { + "path": "internal/hostcollect/statfs_linux.go", + "bytes": 1134, + "sha256": "43ca6c407ef8f3d1ffa23d865035dfaeaeca52dd660913df056f701bebb4595c" + }, + { + "path": "internal/hostcollect/statfs_other.go", + "bytes": 359, + "sha256": "74771f19829dc681362ae769924533c3152e39b066d40f5f16d9372f38934796" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1/cmdline", + "bytes": 20, + "sha256": "8f43111c5dbdb75d6121c113f27e41ed65ddd91f79a4d280a7793644a1e2244d" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1/stat", + "bytes": 171, + "sha256": "d9b44cbd31b1c9c8da40f982f49d4154bc8e3810c9e4429ca0bbf59fee396292" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1/status", + "bytes": 157, + "sha256": "a19e6bad7677a3c02888e758935b3469482bec3d755b20b9638121b44faededd" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1234/cmdline", + "bytes": 75, + "sha256": "0cd56c146bd42f84c829d9fd06d52de5192b15988d7742a1c700e20dd1070eef" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1234/stat", + "bytes": 167, + "sha256": "aae554ac6968f668443d4e5283fe31ca245c80034c42ac1e13277347c148cc98" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/1234/status", + "bytes": 78, + "sha256": "4ffc7f7da787054a34e31d5d303ff95f8edfdbe8143400bfb4ab3b85e5630a06" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/2/cmdline", + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/2/stat", + "bytes": 136, + "sha256": "f7fc6c59fa1ccf495b9608c420e472b4ed405bd11bfceb02e1900a4e4b99fd72" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/2/status", + "bytes": 69, + "sha256": "7e9467884cf5359546aa4a24b33236111de0af34a18d4873d6ead17c81c56081" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/3131/cmdline", + "bytes": 14, + "sha256": "c6a59b7eb746472a2493455caa2f2a4b18da4f890f25ec59581cbca9b14f9407" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/3131/status", + "bytes": 30, + "sha256": "514ea4b40d9cee959efb14e2ffc043cfaf5aa7cda745a7045a97bea5095e9e92" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/4567/cmdline", + "bytes": 29311, + "sha256": "8a1cfbc4849942a3c77ec5637a732d31ba17e4ef1b7d9bd91da7adfc66e54b66" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/4567/stat", + "bytes": 177, + "sha256": "981dbc669634a96080605a175bec9e79fd579d773bf0a862bca0520577d7eb7d" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/4567/status", + "bytes": 83, + "sha256": "9ca027a28df726b1db16e333495f36d1e1e4bc385fdfcf220b9f5c35974538c8" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/5555/stat", + "bytes": 145, + "sha256": "e1e0b7429c1647d083e80dba70a59682170b395289ddc7f5d73ef8f50c5b2946" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/9999/stat", + "bytes": 23, + "sha256": "cffb37e40f1d88418d5e3880fcd5757639295bd8a74a21ab03e33876756fb650" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/loadavg", + "bytes": 28, + "sha256": "48315a4d11f9e94aef6aacc868cdde5b37c5be9f319d10f94c0e3199ad62a9be" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/meminfo", + "bytes": 442, + "sha256": "2865496fbe33eb0d29b5dd8bff079e8c90e0517a0ffdf607d45b3ef5dee70be2" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/mounts", + "bytes": 598, + "sha256": "d5706ae3825221be30a255cab0e6d674ad8cf926f44fea7d639b4cdf43d2c4bd" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/net/dev", + "bytes": 721, + "sha256": "d30e93c506d3e26dedadb795613bb96f87b0100fb60167d97c3e25b2c930c578" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/self/stat", + "bytes": 89, + "sha256": "a6ddedb1d76b0e3b8b8e3e50ac011adae1b6602c7f079f1729bc159ff7d2d88d" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/stat", + "bytes": 357, + "sha256": "2d56a487ae39f8fe095ae9e661b9c26e283873a65556803129d1b537afffb6cd" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/sys/kernel/hostname", + "bytes": 6, + "sha256": "427face3de91cfff25342007697ad3f00efaa38a6b47b1680e513af7711b6b62" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/sys/kernel/osrelease", + "bytes": 14, + "sha256": "c8b508db3dc3d6b06deabb7e0e7c8a457ce7c0885f61dfb8b0d453db8125e7b7" + }, + { + "path": "internal/hostcollect/testdata/proc-healthy/uptime", + "bytes": 21, + "sha256": "0021c8078eaa878bb62b0ceebdaae6494b46baf8f19d4e9b6167cc16faac1761" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/loadavg", + "bytes": 11, + "sha256": "53c7cfd2becc641568baf46f09f8b595c5ee68fc2237c63a5060d7671d6c0e2f" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/meminfo", + "bytes": 277, + "sha256": "06a8b6f816c25f72d803a727a490c3df1f0bdae6adbe343b8cdeae12c6a9f11c" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/mounts", + "bytes": 100, + "sha256": "316d18e13d7c4caab87c3cae3fcb8d4ae1331c1535e30af940cca8646872f85a" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/net/dev", + "bytes": 200, + "sha256": "7b423a538fe6b92e1d53683f789a2ca4cc82b71482336ffca3a90c3d4acb81e0" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/stat", + "bytes": 119, + "sha256": "56532f620f6856f0bdbd4ab4b331dbb42db15a372d274a3c32ed6271e6c74e70" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/sys/kernel/hostname", + "bytes": 26, + "sha256": "e93f54f0261b79debaa48a5e18d32aab1aaa02e87ada4ebf187e301adb9edb16" + }, + { + "path": "internal/hostcollect/testdata/proc-messy/uptime", + "bytes": 9, + "sha256": "2f9d23efc183016965f402b0ca2bfc1edb5830759a169288d8bc19dd99abe9c5" + }, + { + "path": "internal/hostcollect/testdata/sys-healthy/class/net/br0/operstate", + "bytes": 8, + "sha256": "7f51b4fb44dbc72708fac0a474600c2e9d8af4ce3a8b8f1680330454f6a8d68f" + }, + { + "path": "internal/hostcollect/testdata/sys-healthy/class/net/eth0/operstate", + "bytes": 3, + "sha256": "6dcab36746762397d531bb3d0e00c31b7aea21ab3371c1149e3ca1ba20417b61" + }, + { + "path": "internal/hostcollect/uptime.go", + "bytes": 1016, + "sha256": "f4e7f2870141e8a43cb03ab35dc7bf0cb105deade33b2a67b73440be59b46f20" + }, + { + "path": "internal/incident/owner_notes.go", + "bytes": 2627, + "sha256": "6fa9b45af434a28bd4656ab3918f8293322f29268a4caaf1ea1adb7e26c527b0" + }, + { + "path": "internal/incident/repository_integration_test.go", + "bytes": 4614, + "sha256": "7a858e40bb023d14ae1be24fff1a71de0879d63fab3bf0f7877f8e59964dd24c" + }, + { + "path": "internal/incident/repository.go", + "bytes": 12651, + "sha256": "8218b8b213f85e8f0964ca5f412c3d09c2fea6bac64a7e41ca72bda0312d99af" + }, + { + "path": "internal/incident/types_test.go", + "bytes": 3020, + "sha256": "26af528a09d9ecce639abc2cd2fb09f602358990f2717d78ce4a18624c05643c" + }, + { + "path": "internal/incident/types.go", + "bytes": 8939, + "sha256": "04218fe5e62fb76235fecf0c8ad1e60477a092d2c970ebe51fe038c53eaec361" + }, + { + "path": "internal/incidentapi/handler_test.go", + "bytes": 5127, + "sha256": "b85345f576ce6ac3f1f23ebaa098e9224b9d6592029ac4741015101b31a2ef99" + }, + { + "path": "internal/incidentapi/handler.go", + "bytes": 9115, + "sha256": "555c4468d469f68bc6ae87da9ab8eb10c0a63c5bd32c98c80e5a323ebb294a40" + }, + { + "path": "internal/inventory/readmodel_test.go", + "bytes": 1284, + "sha256": "2b6efec56ef58389153f727e537ded2d226ff29185fb5e49ff76ba9e53fea72e" + }, + { + "path": "internal/inventory/readmodel.go", + "bytes": 13423, + "sha256": "3ef38e65ec5efddf5b0f8e4ff3632145fd23e4cfcbf27fd02b03cd2b33053281" + }, + { + "path": "internal/inventory/repository_integration_test.go", + "bytes": 12194, + "sha256": "81199126e45f6cb6f0dca39d2387db1c798eeae75bbf6623a6a8988de0b0f69c" + }, + { + "path": "internal/inventory/repository.go", + "bytes": 13331, + "sha256": "812b84675a8a6450384c93863288f3d2ab7daf021733442597c15cc21289538b" + }, + { + "path": "internal/inventory/types.go", + "bytes": 1724, + "sha256": "378de71ca82945e6ae9073e012f97680a3a1b0e20fd40cee08c9332bfd832bc4" + }, + { + "path": "internal/inventoryapi/handler_test.go", + "bytes": 4678, + "sha256": "81b6147cdb0eb05fad09d42e6aa9c08edfc9f242f92fa5ef38006266e39b702c" + }, + { + "path": "internal/inventoryapi/handler.go", + "bytes": 4706, + "sha256": "7c1b08dc0963bdd3afaa0a48f7d84dbcdc3cbb4ab916ec28904c8d732e49581e" + }, + { + "path": "internal/lifecycle/types_test.go", + "bytes": 2312, + "sha256": "97a005bce391f485e3c34bf9be0d3e3eca1fb2dd4b651195cf7c8fd3aee0c910" + }, + { + "path": "internal/lifecycle/types.go", + "bytes": 6990, + "sha256": "0c36637f9c83b38ab5df15bc0986794353581920174d0d489881742d9d3e0e8e" + }, + { + "path": "internal/live/backpressure_test.go", + "bytes": 528, + "sha256": "af1faa94da2293ac9bf46a32fe13608f9fb32886dae3f4abb77fdd2a29302690" + }, + { + "path": "internal/live/live_test.go", + "bytes": 7992, + "sha256": "b8819e98f74d7a9ed2dc54d54ed45dfc4cbfb7f8ed1bc0037cc789309d0d2c0b" + }, + { + "path": "internal/live/live.go", + "bytes": 15481, + "sha256": "2878be9a5946e43930cb04ed6a7cbc6160a6878fa6328ccdd8f3cd65d92b2bab" + }, + { + "path": "internal/live/registry_test.go", + "bytes": 4818, + "sha256": "417247458190ccbe9aeea59d26f0008000198d9a5204a6a827887a87e578b6f1" + }, + { + "path": "internal/live/registry.go", + "bytes": 5527, + "sha256": "899812ad3adbf968680c9097df848415e53b6dfda525af82a9d139937b733dcb" + }, + { + "path": "internal/livesampler/sampler_test.go", + "bytes": 12375, + "sha256": "f851c3be0fef331d8d291d1bdd25676414f5c89fd400e53b46bcdd3610444dc2" + }, + { + "path": "internal/livesampler/sampler.go", + "bytes": 11759, + "sha256": "ca70872683779f664f110f885f6f1ab6a9a676656b8c517c2ecb216a07d2af1c" + }, + { + "path": "internal/m7gate/close_test.go", + "bytes": 3451, + "sha256": "176088071ebdad829b5c2da76da4571f5119f20351be05ee6f6f4526c4311701" + }, + { + "path": "internal/metriccatalog/catalog_test.go", + "bytes": 4618, + "sha256": "3ade65debc1b20d5ad811c4d91f6225851f1ea0b815e7dda849dbd4333e5887c" + }, + { + "path": "internal/metriccatalog/catalog.go", + "bytes": 11513, + "sha256": "e56e1bad26fedfdd31dca69fa57a3d4ba394627006ed156a11f78fe74c927e46" + }, + { + "path": "internal/metriccatalog/seed.json", + "bytes": 11759, + "sha256": "ee0de854435b396efab1886a233303afff4555c13861c35390665f9e27facbab" + }, + { + "path": "internal/metricquery/handler_test.go", + "bytes": 5387, + "sha256": "593eb9101056b40e813d14eb18245560013e1c2afbf01954d0cc122452623fa4" + }, + { + "path": "internal/metricquery/handler.go", + "bytes": 4274, + "sha256": "15939b31bb3d46c1ea3c2d641cf804fa589e167344f6e3945c698d050f187bfd" + }, + { + "path": "internal/metricquery/service_test.go", + "bytes": 9216, + "sha256": "b480ebd1e4a4bcaba619177582879a00756e7da2739d7fb636faa25c2c6f756a" + }, + { + "path": "internal/metricquery/service.go", + "bytes": 10515, + "sha256": "592074dcd728269c2a969f372ba0f0f2a3cb43df174d689020334a7c6f221541" + }, + { + "path": "internal/metricsapi/handler_test.go", + "bytes": 1771, + "sha256": "0e38c081c810ef3f58e6fbbb6fa23689219a4c753ec271e5e7c953a9f448a314" + }, + { + "path": "internal/metricsapi/handler.go", + "bytes": 1026, + "sha256": "57911b874dac21f1c434b15a56b5e250cc10fb97df2ee6c9136743324b859223" + }, + { + "path": "internal/network/provider_test.go", + "bytes": 1080, + "sha256": "728136e48d6b8cf54caedc87c076b8fb0fa5bbe89e27267cc68039a440ce9df3" + }, + { + "path": "internal/network/provider.go", + "bytes": 1410, + "sha256": "abf38eb1b5603dd1f76074f506f4b9cda269de334f4b5cef4ae66e1cef3e03bf" + }, + { + "path": "internal/network/types_test.go", + "bytes": 6743, + "sha256": "171782befc08e371a70fc4663572deddb36b0f001b5fec6a9bed63d5a7dceaa5" + }, + { + "path": "internal/network/types.go", + "bytes": 13236, + "sha256": "e6bf8d5fdfd2a22ce8b57bd608d451cbf80a1991206ccb53c73684687206eed0" + }, + { + "path": "internal/networkapi/handler_test.go", + "bytes": 1842, + "sha256": "d7d286b1bf3190998fbb66fc1ed9f217e7bc3e50f7256e691232d95ada9d78e1" + }, + { + "path": "internal/networkapi/handler.go", + "bytes": 1392, + "sha256": "227b5d84bcac2cd4055076ddaf15cc9b7e9a1fb45a88b79e921508da64ecc454" + }, + { + "path": "internal/notification/dispatcher_test.go", + "bytes": 2572, + "sha256": "3645527924103622042c90788bef785fd5e057f664fa7a4f7a4f6bc0ffdf95af" + }, + { + "path": "internal/notification/dispatcher.go", + "bytes": 2105, + "sha256": "ba9907c42fbd416500ca8678143c1f5a6ccddb2b92e306d2569a6341f1de780c" + }, + { + "path": "internal/notification/repository_integration_test.go", + "bytes": 9669, + "sha256": "394984cbecd366584650ffb775e04abb409aaf4d1fd96b014dab347422dafcc6" + }, + { + "path": "internal/notification/repository.go", + "bytes": 17216, + "sha256": "90dc173b21fbf6813453ea5feb27101041134105ffe96c88e2eb7ee5151052e2" + }, + { + "path": "internal/notification/types_test.go", + "bytes": 3316, + "sha256": "bd18277bca4b8c1a2308005eef4ad3085e159747a82a3d81ceb14c2bcc9cfd0e" + }, + { + "path": "internal/notification/types.go", + "bytes": 5809, + "sha256": "e1b0eeb8565c6f4c4fce931ac49f98e31da8b049a1533c4d19275d555cb585a7" + }, + { + "path": "internal/notification/webhook_test.go", + "bytes": 5476, + "sha256": "4839c21771ae33e27703c067197e5040e397ee92021cbeb0b6f1960c44d8cdb9" + }, + { + "path": "internal/notification/webhook.go", + "bytes": 6022, + "sha256": "f383969cc6a3f4988955bba04050581fa3d33fa6d0e9e0359943f776a3160810" + }, + { + "path": "internal/observability/metrics_test.go", + "bytes": 3093, + "sha256": "06936f936abc32298884e1eeb2572a088c25aadf9eb2624e63e4d66f2a0aa4f6" + }, + { + "path": "internal/observability/metrics.go", + "bytes": 8094, + "sha256": "0887d65b6c214eec6dd7e859cbe061af02a2148bf2334cd271e94da688cc78a1" + }, + { + "path": "internal/onboarding/default-dashboard.json", + "bytes": 7114, + "sha256": "c1b91a9e24f8b3d1eb70becf22daa7390682dfaf020543df0b8f6e6289c88ed7" + }, + { + "path": "internal/onboarding/repository_integration_test.go", + "bytes": 1839, + "sha256": "89b5de6b20cc5f072ae98f73a904875c45174f384f676579162a0ad042af6a5d" + }, + { + "path": "internal/onboarding/service_test.go", + "bytes": 2297, + "sha256": "f96e189a39bc6405ca83db1e67bbceb84047b3d1bab9d11505d7058f00c98961" + }, + { + "path": "internal/onboarding/service.go", + "bytes": 8194, + "sha256": "4822fd06f0aae3c099222c2f8dcad69718bd7055462567910fdfc8aa3565eb91" + }, + { + "path": "internal/onboarding/store.go", + "bytes": 1615, + "sha256": "50dd7e016aaad4cde89e8ef3e3813d520729e06c47b6cb98f0505b142b673581" + }, + { + "path": "internal/onboarding/types.go", + "bytes": 904, + "sha256": "f28a6038024a7796eca3cb83b397b86a4eb065938a18bdcc0ac64f16f9710e98" + }, + { + "path": "internal/onboardingapi/handler_test.go", + "bytes": 2486, + "sha256": "91a0bcad4fdcf1df10ddddc05b8db2bdd01d565409dbd314427acca8133cb0b2" + }, + { + "path": "internal/onboardingapi/handler.go", + "bytes": 2938, + "sha256": "223593f11362eae9afa7e50c75a5cfa974a7435c040ec22ee394d3b0e75946e9" + }, + { + "path": "internal/pool/types_test.go", + "bytes": 6626, + "sha256": "95aaf1d655edda2020c14144fb4687697289b630f229e27f86f5875c98ea34ec" + }, + { + "path": "internal/pool/types.go", + "bytes": 18442, + "sha256": "220f7b25e9b6395550d57fdbf4763d08542edaae4856ea9ccc871fb737920b59" + }, + { + "path": "internal/poolapi/handler_test.go", + "bytes": 2467, + "sha256": "8a61c30af13776c8be8faf15224fd703292dbdb559dc6a3ee07d4e6267230c5d" + }, + { + "path": "internal/poolapi/handler.go", + "bytes": 2497, + "sha256": "84550697e39b0837eadf149d3c064be3cb48632d5b8a2620023f3d860d2552a0" + }, + { + "path": "internal/probe/executor_test.go", + "bytes": 10407, + "sha256": "c76f330b5f4b32d9299bd5bdf8a2a173db813497c4f5b70916d0c64a686c102c" + }, + { + "path": "internal/probe/executor.go", + "bytes": 9486, + "sha256": "4449c9e4c6e808b59ecda1d8685d3f9dda57c55b09a06a08cec982c9098a0f7c" + }, + { + "path": "internal/probe/policy_test.go", + "bytes": 4211, + "sha256": "771b8c9f0f8f167de5b7323294e3971a8696a65cd4b78fba6e2c1ad6c4fc4340" + }, + { + "path": "internal/probe/policy.go", + "bytes": 10167, + "sha256": "4ba0485cf3e4a6ea350c1387021693cc233710796506ef7aebf445ef40540826" + }, + { + "path": "internal/probe/scenario_test.go", + "bytes": 1661, + "sha256": "57f71fdee0e85ae74660705a63a35e88b89fe8b0de725f4b3419002400f7080d" + }, + { + "path": "internal/probe/scheduler_test.go", + "bytes": 4907, + "sha256": "feab7038a241767498f421288061284f58e814c6dd4cd79d04dd9872f8d6cc07" + }, + { + "path": "internal/probe/scheduler.go", + "bytes": 8204, + "sha256": "02ce19518a8263421538666e1da60f29a645ec8cfe238118a7fcf1aed3d88c45" + }, + { + "path": "internal/probe/types_test.go", + "bytes": 739, + "sha256": "0f18a0bdd5f5a8b51c10e865f723e20f4993e8383c2d737a2f4f042d93407cdc" + }, + { + "path": "internal/probe/types.go", + "bytes": 3633, + "sha256": "2700ddaa38f8b035d7a8f7aaed5d6ae1532becc5c7de081997da7cde7962c79a" + }, + { + "path": "internal/problem/problem_test.go", + "bytes": 1260, + "sha256": "c53c4908cc79f43f9bfa60e5949241c249af7e36ac95d2a988c6acfe949ddd76" + }, + { + "path": "internal/problem/problem.go", + "bytes": 1215, + "sha256": "1a4d59b9d377d689875890bb1a54869bafeb708ce8d40aec227052fcc6fc0546" + }, + { + "path": "internal/process/types_test.go", + "bytes": 3177, + "sha256": "2db28ad36269b4e51579750b48a033c61b8efc92a01f0920497b022ce5546e26" + }, + { + "path": "internal/process/types.go", + "bytes": 8266, + "sha256": "3d1e36818b56c4153c2c8ee7fbab38af5161d3741a7078051dbef37a75be6609" + }, + { + "path": "internal/processapi/handler_test.go", + "bytes": 2308, + "sha256": "411523f3eb5dff226484f030fb8bd12f8d542c219c65970a3e0d6268bada4262" + }, + { + "path": "internal/processapi/handler.go", + "bytes": 2140, + "sha256": "f3bbc1546f149e69e94d0ffa16f0af600ff7564d47b89c98638383b9301a51ed" + }, + { + "path": "internal/prometheus/client_test.go", + "bytes": 4634, + "sha256": "62adbe5991b36647871448cf6427bb09a0c189772ab1106c47462c4fb183561c" + }, + { + "path": "internal/prometheus/client.go", + "bytes": 6495, + "sha256": "d9890c7b5503896ac4c050d1ef6abaa2d58f52c3c28b902b550220c570ed29e0" + }, + { + "path": "internal/promqlbinding/binding_test.go", + "bytes": 5620, + "sha256": "db04a8731d48bf7b19b94c8f94736c41482ea91c121482ffd8f7814e23c0a6a8" + }, + { + "path": "internal/promqlbinding/binding.go", + "bytes": 6157, + "sha256": "702d83f7b19447ef36d53673902623437cf60003a76d2e57a958fc628e0e67b4" + }, + { + "path": "internal/queryplan/planner_test.go", + "bytes": 4499, + "sha256": "f2a6ee32c4d921c1d9c926f1c86346c69c11ab1cfc23bb872cc0c65a331339c4" + }, + { + "path": "internal/queryplan/planner.go", + "bytes": 9167, + "sha256": "18b4499da5035d73a6c573afe2c3c43f666ad799ea915ae2844233ec33c56a72" + }, + { + "path": "internal/reconciliation/container_identity_test.go", + "bytes": 5723, + "sha256": "457ea25465f470ae360760cf76af2b0672032ba1260bd8dae34c9fe6a5772bc5" + }, + { + "path": "internal/reconciliation/container_identity.go", + "bytes": 7373, + "sha256": "329e5ce7bcb3d03d57b45b165a1d53bfcf1df67ee16f52f5ed2ab80ec271406c" + }, + { + "path": "internal/reconciliation/engine_test.go", + "bytes": 3563, + "sha256": "575a9c650b3ab3a95cf150808051c30810aaf1e3f22eebaf64f1918ce895eaa0" + }, + { + "path": "internal/reconciliation/engine.go", + "bytes": 3761, + "sha256": "410a0857f8a884fec0dc9a0bba173d0f48a60d796d633d266cee57197883f3e0" + }, + { + "path": "internal/redaction/redaction_test.go", + "bytes": 760, + "sha256": "fb6707f7dc247d36fc6cd856a1221336976d07e3df347cd9db0f3d110a413fc5" + }, + { + "path": "internal/redaction/redaction.go", + "bytes": 983, + "sha256": "bced74081f750e17072233f05719cdcc6de82479adbd7c00a521e1b38e06785e" + }, + { + "path": "internal/reverseproxy/http_client_test.go", + "bytes": 2302, + "sha256": "2ab401bf1473ed28661a42fdb061b316387c00a1881d004bae3849256244d439" + }, + { + "path": "internal/reverseproxy/http_client.go", + "bytes": 4141, + "sha256": "afcf5034f5d71b11a763449b9e3b1106574c6b051a9b7bed0d613d0e38455cc9" + }, + { + "path": "internal/reverseproxy/types_test.go", + "bytes": 4560, + "sha256": "5ee916c7984ebbe1d9ebcf2aac2502701c49418dcdc8b5a1f471bbf6b1976735" + }, + { + "path": "internal/reverseproxy/types.go", + "bytes": 14608, + "sha256": "df59a97d9f3dc0e826081b9faefa73df88776e379d074dd5cdd4bfb9de1f5260" + }, + { + "path": "internal/reverseproxyapi/handler_test.go", + "bytes": 2416, + "sha256": "5e9e7c816549bd179ee0b48c76755d26311fd3afe935e69d50c2d34753f0cf3b" + }, + { + "path": "internal/reverseproxyapi/handler.go", + "bytes": 1682, + "sha256": "19b23d6fad08626787da801a34c0458ec2b3efc93e963e926d2a9c46cb8924c6" + }, + { + "path": "internal/runtimeconfig/agent_test.go", + "bytes": 4872, + "sha256": "9a420f0d1f39ec6b57f50b4737dddb40c0c2e5acbe94d12d19deffd8733d16c1" + }, + { + "path": "internal/runtimeconfig/agent.go", + "bytes": 5627, + "sha256": "1d1ec4172324a27e5bea5a1d224f87c91bd7a2821b3100e0a3d400bc6be4f281" + }, + { + "path": "internal/runtimeconfig/config_test.go", + "bytes": 744, + "sha256": "9e6ea8e70cd79fb23c2d4e17d63d70427e37568b956c8074cd090a9c652ec5eb" + }, + { + "path": "internal/runtimeconfig/config.go", + "bytes": 3063, + "sha256": "57a8a05abc0c981a6557ff8a4925b934cb372744ab85b8f8f52cb2310c77dbd1" + }, + { + "path": "internal/service/dependency_repository_integration_test.go", + "bytes": 5664, + "sha256": "621bc44075aace0a2f6b92dd27b62bb55780dcf2a92bd92a83575e67aad7e37d" + }, + { + "path": "internal/service/dependency_repository.go", + "bytes": 9773, + "sha256": "5881ed4a9df3ac9dc9c79673e5d58dd2f57658ecbdc162c8d0034ccc69989d8a" + }, + { + "path": "internal/service/dependency_test.go", + "bytes": 1911, + "sha256": "67d2f4a337310c0f262272bd9a0181bfefcabfa9c403f63111cef0edcaa84550" + }, + { + "path": "internal/service/dependency.go", + "bytes": 4306, + "sha256": "899890bb6f81319110d000bf9cb503b3a1929197e0b24d9e0439d471ad369c08" + }, + { + "path": "internal/service/health_test.go", + "bytes": 963, + "sha256": "3d3ba174ce28a3039d0c80a3de2603722d5c0d33ea64722a681a22fba2b37fe5" + }, + { + "path": "internal/service/health.go", + "bytes": 701, + "sha256": "cb36170685d8a52724cae381d83353139ce129c6b15cb5550c31fec3b77adef5" + }, + { + "path": "internal/service/postgres_integration_test.go", + "bytes": 3574, + "sha256": "664194ff90d87a9b58ddc725fdffc7d619089729aa9e60d64c86edace93c2eb7" + }, + { + "path": "internal/service/postgres.go", + "bytes": 8178, + "sha256": "9ea4c7c02529f8041c0c3a57f1b38a98cb55cbd7b14f9ad9ef4d737ffc9d470b" + }, + { + "path": "internal/service/scenario_test.go", + "bytes": 2259, + "sha256": "40afb4ad69b8ff0eff978d7e23f099e68028a148f8cdc0c341a5969106fd9b02" + }, + { + "path": "internal/service/signal_test.go", + "bytes": 452, + "sha256": "bc1c83b09cce3d59e784de15ce8da39332e629beff4420c2054e8e819492185c" + }, + { + "path": "internal/service/signal.go", + "bytes": 335, + "sha256": "978bdc7824821f54df16b39b8036ff5b86798d0485b010f2a5bcaa182f343c40" + }, + { + "path": "internal/service/status_test.go", + "bytes": 8317, + "sha256": "f359e66c44aea0adf187f6970af22fad1a7181401286728f98ffa60f526bce9a" + }, + { + "path": "internal/service/status.go", + "bytes": 13334, + "sha256": "9a9216d9104c524397998a39fe5329b7e2e49de811df6d49d8f0671e3ae948a9" + }, + { + "path": "internal/service/topology_reverseproxy_test.go", + "bytes": 899, + "sha256": "f406e8d6de3b470e9705b387227792c4f4671448de5ede88f0d698785e847f57" + }, + { + "path": "internal/service/topology_test.go", + "bytes": 4459, + "sha256": "7238599b2aee8322bbb17da48a00bfb73717ec43760e0e0862f8bf72f30ef1be" + }, + { + "path": "internal/service/topology.go", + "bytes": 5737, + "sha256": "9587dd9cd8650a97d8336f4072b7abda3ac8df6e54aa4878fea195bd04ec5861" + }, + { + "path": "internal/service/types_test.go", + "bytes": 725, + "sha256": "c8bce6fe1b29374c01f6ce599035e6b58b7d42a2da9bc7038dfe685f2845100a" + }, + { + "path": "internal/service/types.go", + "bytes": 2332, + "sha256": "1e1431da21d36853b05fd4e3607983cd172c5f8a5f601893eccdc046770c4e9c" + }, + { + "path": "internal/serviceapi/handler_test.go", + "bytes": 7474, + "sha256": "185727e5baa78182bd4e3fdb0a93da8afb3904773f44306421d7d7372ab1480d" + }, + { + "path": "internal/serviceapi/handler.go", + "bytes": 8308, + "sha256": "686719607459377050eb521c92c3958329ea2754485f8e02dabd0b477820160a" + }, + { + "path": "internal/servicedefaults/seed_integration_test.go", + "bytes": 2835, + "sha256": "08987da86e908cc4e7a63dbb252d7df3da360dea6ddcc2faa340db892ce3bafa" + }, + { + "path": "internal/servicedefaults/seed_test.go", + "bytes": 2461, + "sha256": "632130860bfb9c53ced64e8c85a477f53b914c63c573c2958d24eea0b9f7e0cc" + }, + { + "path": "internal/servicedefaults/seed.go", + "bytes": 9315, + "sha256": "9d832c68dfacc37e2a30555dbb420290d91f942a805957c292a78ba8b02eabef" + }, + { + "path": "internal/share/types_test.go", + "bytes": 3063, + "sha256": "186052ce31117119273d952c80c3bf2899f0d3f4f5393d6f8d9029ebd7b17b33" + }, + { + "path": "internal/share/types.go", + "bytes": 12164, + "sha256": "3fcfbcde3d127ff5521d1484e20ec6a294896a0c3ec7400b05904fa01b418c0b" + }, + { + "path": "internal/shareapi/handler_test.go", + "bytes": 2316, + "sha256": "da3e00604990112b0e930edd3ed78529a8c4da8ff9187ca34ddc0359bf5d900f" + }, + { + "path": "internal/shareapi/handler.go", + "bytes": 2525, + "sha256": "657e0579d7f90d8529570f3aac592d5d2340e8df73bbc9a29c81776dabc31bab" + }, + { + "path": "internal/storagescenarios/scenario_test.go", + "bytes": 4998, + "sha256": "cfec18d1e061023af6c15c19db97b1d1057fbfb95db9acce0ee392db89b8726a" + }, + { + "path": "internal/systemstatus/status_test.go", + "bytes": 9040, + "sha256": "9f6def1236572dc626b35251a83e418c59f6f3f59b89313eaef7decc658faaa7" + }, + { + "path": "internal/systemstatus/status.go", + "bytes": 14100, + "sha256": "d2105bd5a0469bd9f032450211f7dca33df85960e69b9f7698cdb0a8626e4847" + }, + { + "path": "internal/systemstatusapi/handler_test.go", + "bytes": 1900, + "sha256": "341b366b9b80290bbc99fd541eb06bf65e1dd1563ffb8a902ca5e98aa01bd34d" + }, + { + "path": "internal/systemstatusapi/handler.go", + "bytes": 2227, + "sha256": "11d62adf8cc82fec18c007d5f1eab29bca601f21c1cac309328cd5e93ca4f5d3" + }, + { + "path": "internal/unraid/array_test.go", + "bytes": 2501, + "sha256": "6fc4bf7cf608d8e0fb3d80c3ce00e48af9c60b7adc4234abfcb8a9ca06f550e9" + }, + { + "path": "internal/unraid/array.go", + "bytes": 6389, + "sha256": "7d607e6573429d388c3a4c64832cd621244e8dc3d8eec723091ca553d360811c" + }, + { + "path": "internal/unraid/client_test.go", + "bytes": 2992, + "sha256": "e50b970e1d305a730cf04abcce36e3267ee41acc3c9deb377fe8e3058855baaf" + }, + { + "path": "internal/unraid/client.go", + "bytes": 4498, + "sha256": "91249496210fc255e62e2e3e172ca5391018a2d668a628580d417e49681fc0d8" + }, + { + "path": "internal/unraid/containers_test.go", + "bytes": 4436, + "sha256": "ea7c83b8160a3448ad69ce595872846918badae52b2897a12e5b6228cd153a83" + }, + { + "path": "internal/unraid/containers.go", + "bytes": 3673, + "sha256": "3101aa7a81b25371d52b7eea466bea1ffdc0de824d0baf0cf29f23223adafc7c" + }, + { + "path": "internal/unraid/pools_test.go", + "bytes": 2301, + "sha256": "2d5857a37a6b05f510f97531e8acb69f26bbc64ab3e1bb8affce02611d9e3257" + }, + { + "path": "internal/unraid/pools.go", + "bytes": 2300, + "sha256": "beb61f6914531114ba07b8571eac136675fc7020cc9396cf5675031698859e16" + }, + { + "path": "internal/unraid/shares_test.go", + "bytes": 1079, + "sha256": "507e71d4475de242a090222e5afd166506b7887f8504727cb80ee9744287f766" + }, + { + "path": "internal/unraid/shares.go", + "bytes": 2476, + "sha256": "ab9f9a2706d72d8715695999b935ebaf507545cf7c3f6194f7f77bb66554fd9b" + }, + { + "path": "internal/widget/registry_test.go", + "bytes": 631, + "sha256": "59e2492c0a68cdf0442120f25ff8ab7f95725d7af7570ac22c58b5f8f792fc52" + }, + { + "path": "internal/widget/registry.go", + "bytes": 3127, + "sha256": "78638aa79f6cf6df773d19f2b0fd9b40ba17d5d0e1973557ec52f63373bc55cd" + }, + { + "path": "internal/widgetapi/handler_test.go", + "bytes": 3160, + "sha256": "06909b1c871449744ec1d4360a9590d6c48b74f5d2b0c94ac262fd56898fc9b6" + }, + { + "path": "internal/widgetapi/handler.go", + "bytes": 2809, + "sha256": "ff0996aafc3c7481e8759aa039ee7f484471f5ce94454e62614f207e661740e2" + }, + { + "path": "internal/widgetpreview/preview_test.go", + "bytes": 1818, + "sha256": "027a894194f4db654c91cb82c95025baf2edbe537b1ffbddbefdb0756348d2fb" + }, + { + "path": "internal/widgetpreview/preview.go", + "bytes": 5940, + "sha256": "9fc08702b2d594e7494cd3c7225829457ba3ba6ddcd3bb315016095ff197d2bc" + }, + { + "path": "internal/workerruntime/alertjob.go", + "bytes": 18242, + "sha256": "606975a9fc5783ab99af0550349b4392eb5bbc2ef428b958f95935d9eca29fde" + }, + { + "path": "internal/workerruntime/discoveryjob.go", + "bytes": 26387, + "sha256": "124baa10539b073dba44c62d77f1189a61419a611741dea255753efee24b05ed" + }, + { + "path": "internal/workerruntime/inventory_discovery_integration_test.go", + "bytes": 4332, + "sha256": "e1a4bba16dbb2fd9d88528d5ceec781d8bbb69d8a91974d53f726ebc747e094d" + }, + { + "path": "internal/workerruntime/jobs_test.go", + "bytes": 26790, + "sha256": "1fb4327b2ed7d085596f79cd03510ed538adf74c6f1213b9bc0e92a1ed329f79" + }, + { + "path": "internal/workerruntime/lease.go", + "bytes": 10371, + "sha256": "55de7f47dc35323fdfa4d31bbd518cff6b9314b399cb33b81010332bd38491f0" + }, + { + "path": "internal/workerruntime/metricsource_test.go", + "bytes": 2707, + "sha256": "e9602aedfa6c527ba080c4ef32d81844cd4db0e2a9356922fd563961576661ec" + }, + { + "path": "internal/workerruntime/notificationjob.go", + "bytes": 4176, + "sha256": "ce4a6222bdf6d0647351d45c8237e11deac068e512a7e1b21b1322941fb1428b" + }, + { + "path": "internal/workerruntime/postgres_integration_test.go", + "bytes": 7774, + "sha256": "a5db0c0075a92887e556e5979618ed721cb52bc0eb8a69b0f0aadbf8a90df9b2" + }, + { + "path": "internal/workerruntime/probejob.go", + "bytes": 11687, + "sha256": "58128b3b6f96b2d59a7d22579d868f855135289774a8b93b4535dfabdf4e639e" + }, + { + "path": "internal/workerruntime/runtime_test.go", + "bytes": 19146, + "sha256": "af2b145e73027772430a1c73de8c6620329aff7095a5ebeebd70d0eef953d268" + }, + { + "path": "internal/workerruntime/runtime.go", + "bytes": 19088, + "sha256": "2b6e088c0904810a7f160564b43006627d2b043e6720e9acb7cb0316b2428b4b" + }, + { + "path": "internal/workerruntime/schedule.go", + "bytes": 3303, + "sha256": "938b8bf3de9bbe2e5754f47eccfe1ff9c16b0fb884145bc751f467b23c708603" + }, + { + "path": "internal/workerruntime/status.go", + "bytes": 3415, + "sha256": "f6212a551bfe4b1afd95823e1d14cf804bf478d41913f8a13e85962049be87a1" + }, + { + "path": "LICENSE", + "bytes": 34523, + "sha256": "0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0" + }, + { + "path": "Makefile", + "bytes": 784, + "sha256": "0c3b2573977c40dd96a34bc215c76264689a00e5a8594407c1020f47742ea3de" + }, + { + "path": "PACKAGE_VERSION", + "bytes": 6, + "sha256": "acb57a7135b2d7d6e665f67f056e21353023b93835f54def1ae523bf76f1bfb3" + }, + { + "path": "package.json", + "bytes": 658, + "sha256": "9675238f7793c66b5554261ad7c21efd0347bff43f675c816d2810371335824c" + }, + { + "path": "pnpm-lock.yaml", + "bytes": 60519, + "sha256": "64a540c83307eab5a83bdabd5fd128ead91d166a155b3c51568318999756c1f2" + }, + { + "path": "pnpm-workspace.yaml", + "bytes": 38, + "sha256": "6a7030c7d39d70711fd0a50f8a08d5a62bfc5e75ee513bb8529d9f153c21673c" + }, + { + "path": "README.md", + "bytes": 4690, + "sha256": "5dfc28281b63f0bd9c58e322115926a1aab104f33662d1aaccbf88fb428b2a0e" + }, + { + "path": "requirements-dev.txt", + "bytes": 19, + "sha256": "756cc9e506ae4ee1a6f6c0507088b5cfc0dc8ba350fb2d2d46f1ffa72033adb6" + }, + { + "path": "scripts/bootstrap.ps1", + "bytes": 397, + "sha256": "61dea33e004f79fcfc14d09043912badef897665a9a7d5787c01202830185215" + }, + { + "path": "scripts/build.ps1", + "bytes": 748, + "sha256": "e7f213dcbab9bfb47a2f2a259b17f79352d5519f614fa5b1a5ad6eeb030e7015" + }, + { + "path": "scripts/export-public-source.mjs", + "bytes": 6373, + "sha256": "cd344471a1ee82668a845d1d1cd38704197df3a10fa90d4807a233207a1d1cb1" + }, + { + "path": "scripts/integration-smoke.ps1", + "bytes": 10781, + "sha256": "c7c14a2d4418fdfc12d7bec6f71288c45ecb2e370447cb356830d9c0638199d1" + }, + { + "path": "scripts/lint.ps1", + "bytes": 616, + "sha256": "3dae378474c7336a98cbe607f0d23757655d47f79ea5cf73ec9114c1d7b66d49" + }, + { + "path": "scripts/production-smoke.ps1", + "bytes": 5292, + "sha256": "071c108bc64825747c22c642dc03d2be04ae171f375e280d61193abf781a8f3c" + }, + { + "path": "scripts/public-verify.ps1", + "bytes": 1730, + "sha256": "60260a455045a02b52b3f40969e9a72c6aaacf29f6f66800cd5a8718bf4cf4a0" + }, + { + "path": "scripts/run-trivy-fs-scan.sh", + "bytes": 1283, + "sha256": "40ee184ebed01f534a087b85593986833d948d0e76eb906638130bf2c61836ab" + }, + { + "path": "scripts/test.ps1", + "bytes": 593, + "sha256": "f042bb3cc90e0a60ec5c153ce6ac23908e1f2a3b5d285e3248b7ee002ec6e9aa" + }, + { + "path": "scripts/validate-public-source.mjs", + "bytes": 1704, + "sha256": "3f921525d90f5e3f509dd5b84c45b95d42869fb1a261bc88c7887d39ed20f1ef" + }, + { + "path": "scripts/wallboard-soak.ps1", + "bytes": 4591, + "sha256": "730dc902c28c965f6cefce29b5738fe01bf9c5bebca963e82a909139d106bac3" + }, + { + "path": "SECURITY.md", + "bytes": 1706, + "sha256": "9a0002a2fda4d245dd48c9b4483bbeebb01192b7ec0edfe47b8eb6cc4f090377" + }, + { + "path": "specs/alert-rule-set.schema.json", + "bytes": 439, + "sha256": "6c355e894e9581f90bdfa8e7f42765247d2e0b501907904b7de10d03230eed08" + }, + { + "path": "specs/alert-rule.schema.json", + "bytes": 3358, + "sha256": "ec7b641d0ca7fb1f302ade3c62a2ec4f74c51527958983dc63ea0a2b61339281" + }, + { + "path": "specs/api-routes.json", + "bytes": 13627, + "sha256": "a02c47d8c6c2676ef93c2e13263aee72fdf950c96ef31a7e0210141e3efe6863" + }, + { + "path": "specs/capability.schema.json", + "bytes": 1183, + "sha256": "b2d12876cad6616bcdd3ddc09dd30b8f28a8e781aca48cbe624f9bda88fb78b3" + }, + { + "path": "specs/dashboard.schema.json", + "bytes": 2564, + "sha256": "ee3a0e63430815a69b340e11ca47510a36fd6f35377c7e35ceed32df2207e368" + }, + { + "path": "specs/entity.schema.json", + "bytes": 3235, + "sha256": "133663dea96883e2b075f3e98c45f7177cdfecdb5975270de509119283eb21ff" + }, + { + "path": "specs/event.schema.json", + "bytes": 1550, + "sha256": "63687e38ae42fc9a69d4d16d3e0084e3483c82d4d59e3d5eeea42b2a2b0a4dd1" + }, + { + "path": "specs/live-message.schema.json", + "bytes": 6199, + "sha256": "8c0eb95cee7246d75d3397e56485d15d6e511a5cf18fd5ce96f3dc7e19615825" + }, + { + "path": "specs/metric-catalog.schema.json", + "bytes": 459, + "sha256": "371c5a313e865b0901aaf155f48046de38394340074e046f583247fa9c108eb1" + }, + { + "path": "specs/metric-definition.schema.json", + "bytes": 3997, + "sha256": "e7688f4af41edb7550716a6f59dada9ad494ea12133055d35d2bbf5ac7c466fd" + }, + { + "path": "specs/probe.schema.json", + "bytes": 2387, + "sha256": "2d124d33000a8cac24c35e098d2417e7b77aadf6f40366bba2850de69701d82a" + }, + { + "path": "specs/simulator-scenario.schema.json", + "bytes": 2289, + "sha256": "163efbc7c3a9aa88c9cb8cbfdfb5630d666ac769fe7c4463974a7cd60c225d9b" + }, + { + "path": "specs/task-ledger.schema.json", + "bytes": 2044, + "sha256": "fb740a247691b202b350e488856d7fae7f1b4590e484214260f42eb9a244440c" + }, + { + "path": "specs/widget-instance.schema.json", + "bytes": 4943, + "sha256": "b6987c270484bc37af508eabd3f58cb145e9879d4cde87e5dec3a430ce83ca3b" + }, + { + "path": "tools/analyze-wallboard-soak.mjs", + "bytes": 3102, + "sha256": "c077c019ae465a84050be7952efbc37212b3a08b7afd3e18c3c53c9547933346" + }, + { + "path": "tools/check_api_contract.py", + "bytes": 3086, + "sha256": "43c3d097e662975da7f00f19b49f3b2fb0c65ca30d128b186f6d4aaba8a16133" + }, + { + "path": "tools/check_secrets.py", + "bytes": 1398, + "sha256": "2487e38874d25a6f8bb076b3cf99d6f9ce9528c2feb53af10e4854f8134f0563" + }, + { + "path": "tools/check_wiring.py", + "bytes": 12042, + "sha256": "b2f12bd542aa90d2e46de40dc29724a82c4a727a9d4a96309c3fc8a5672350f5" + }, + { + "path": "tools/deadman_check.py", + "bytes": 1933, + "sha256": "2ea6eddb522a4586573e7fcf4fd8d836d79344ff927d1b1333512e856f6a60c4" + }, + { + "path": "tools/integrationfixture/main.go", + "bytes": 4154, + "sha256": "11b6e1861342a1aa00f713198e5d98e54ebc532447e678954ef18182678a81b2" + }, + { + "path": "tools/validate_contracts.py", + "bytes": 3355, + "sha256": "c6f86decbead6cf481691f7f0f58269842de8fe698ad38d6158ebf812f3209f6" + }, + { + "path": "tools/wallboard-soak-analysis.mjs", + "bytes": 5518, + "sha256": "a8aee8733210c0b681dc434d22f1dacd87a7bbaed234dbb6549a6f23e4b7e934" + }, + { + "path": "tools/wallboard-soak.mjs", + "bytes": 13027, + "sha256": "422e6293cbfa782ea306dbec2ecaa6cd116e8d8506d6a26db81a8be527ee0b63" + }, + { + "path": "tools/wiring_allowlist.json", + "bytes": 503, + "sha256": "413720757d12cbab530ebb8347ddfc32418f20f6934843750e441569c6a3359a" + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..299834c --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +# ITWorx Pulse + +ITWorx Pulse is een self-hosted observabilityplatform voor Unraid. Het brengt host-, container-, storage-, netwerk- en servicetelemetrie samen in één operatorgerichte interface, met configureerbare dashboards, alerts, incidenten en wallboards. + +Pulse is operationeel **read-only**: het observeert en verklaart, maar start, stopt, verwijdert of repareert geen infrastructuur. Ontbrekende of verouderde telemetrie verschijnt als `Onbekend`, nooit als vals groen. + +Actuele release: **v1.5.0**. + +## Wat je als gebruiker krijgt + +- een overzicht dat meteen toont wat gezond, gedegradeerd, kritisch of onbekend is en waarom; +- detailpagina's voor host, processen, containers, applicaties, array, disks, pools, shares, services en netwerk; +- versieerbare dashboards met afzonderlijke desktop-, tablet-, mobiele en wallboardlayouts; +- begrensde historische en live Prometheus-query's zonder dat gebruikers zelf PromQL moeten schrijven; +- alerts met pending/recovery, hysterese, suppressie, silences en maintenance; +- incidentgroepering, tijdlijnen, notities, ownership en audit; +- Authentik/OIDC-login met viewer-, operator-, editor- en administratorrollen; +- controleerbare backups en een clean-room herstelprocedure; +- hardened non-root containers en een minimale read-only collectorgrens. + +## Platform in één oogopslag + +```text +Browser + └─ HTTPS / OIDC / REST / WebSocket + └─ Pulse Web + API + ├─ PostgreSQL configuratie, inventory, dashboards, alerts en audit + ├─ Prometheus begrensde historische en live metrics + ├─ Pulse Worker discovery, probes, alerting en notifications + └─ Pulse Agent minimale read-only Unraid- en hostobservatie +``` + +De web/API-laag krijgt geen Docker-socket of host-roottoegang. Alleen de agent ontvangt de expliciet geconfigureerde read-only bronnen die nodig zijn voor observatie. + +## Snel lokaal proberen + +Vereisten: Go 1.26.6, Node.js 24+, pnpm 10.33+, Python 3, PowerShell 7 en Docker Compose. + +```powershell +Copy-Item .env.example .env +pwsh -NoProfile -File scripts/bootstrap.ps1 +docker compose -f deploy/compose.yaml -f deploy/compose.dev.yaml up --build +``` + +Open daarna `http://localhost:18080`. De ontwikkelstack gebruikt expliciete mock-authenticatie en geïsoleerde lokale data; gebruik hiervoor nooit productiecredentials of productiedata. + +Stop en verwijder alleen deze lokale stack met: + +```powershell +docker compose -f deploy/compose.yaml -f deploy/compose.dev.yaml down --volumes +``` + +## Valideren + +De private engineeringrepository gebruikt een uitgebreidere evidencegate. Een publieke source-export valideert de productcode met: + +```powershell +pwsh -NoProfile -File scripts/public-verify.ps1 +``` + +Deze gate controleert Go-tests/vet, frontendtests/typecheck/build, contracten, wiring, secretmarkers, image-digests en de publieke source boundary. De optionele Docker-integratiesmoke staat in `scripts/integration-smoke.ps1`. + +## Productie + +Begin bij [`docs/PUBLIC_DEPLOYMENT.md`](docs/PUBLIC_DEPLOYMENT.md). Productie vereist onder meer: + +- HTTPS en een Authentik/OIDC-provider; +- een private PostgreSQL-database en externe secrets; +- een expliciete Prometheusbron; +- een least-privilege Unraid API-token en gecontroleerde CA-mount wanneer de agent de Unraid API gebruikt; +- een operator-owned backupdirectory; +- validatie van poorten, netwerken, mounts en rollback vóór de eerste start. + +De voorbeeldconfiguratie faalt bewust dicht wanneer verplichte productie-instellingen ontbreken. + +## Documentatie + +| Onderwerp | Document | +|---|---| +| Productscope en gebruikersflows | [`docs/product/PRODUCT_REQUIREMENTS.md`](docs/product/PRODUCT_REQUIREMENTS.md) | +| Architectuur | [`docs/architecture/SYSTEM_ARCHITECTURE.md`](docs/architecture/SYSTEM_ARCHITECTURE.md) | +| API en WebSocketcontract | [`docs/architecture/API_CONTRACT.md`](docs/architecture/API_CONTRACT.md) | +| Securitymodel | [`docs/architecture/SECURITY_THREAT_MODEL.md`](docs/architecture/SECURITY_THREAT_MODEL.md) | +| Lokale ontwikkeling | [`docs/operations/DEVELOPMENT_SETUP.md`](docs/operations/DEVELOPMENT_SETUP.md) | +| Backup en herstel | [`docs/operations/BACKUP_RESTORE.md`](docs/operations/BACKUP_RESTORE.md) | +| Publicatiegrens | [`docs/PUBLIC_SOURCE_BOUNDARY.md`](docs/PUBLIC_SOURCE_BOUNDARY.md) | + +## Bijdragen en security + +Lees [`CONTRIBUTING.md`](CONTRIBUTING.md) voordat je een wijziging indient. Meld kwetsbaarheden niet in een publieke issue; volg [`SECURITY.md`](SECURITY.md). + +First-party broncode in deze repository is gelicentieerd onder **AGPL-3.0-or-later**; zie [`LICENSE`](LICENSE). Componenten en assets van derden behouden hun eigen licentievoorwaarden. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..be9e2fe --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported code + +Security fixes target the current release line on `master`. Older releases may receive a fix when the same issue is still relevant and a safe backport is practical. + +## Reporting vulnerabilities + +Report suspected vulnerabilities privately. Do not open a public issue containing access tokens, OIDC secrets, session material, private dashboards, host inventories, alert payloads, infrastructure topology, backup contents, database credentials, production telemetry, or exploit-sensitive evidence. + +Include the affected release or commit, component, minimal reproduction conditions using synthetic telemetry where possible, expected and observed behaviour, and impact. Call out effects on authentication/RBAC, query bounds, WebSocket subscriptions, agent isolation, backup/restore, deployment, secret handling, or the read-only product boundary. + +Email reports to `security@itworx.tech`. This monitored mailbox is the permanent private reporting channel for the project. + +## Security boundary + +Pulse is an observability product. Contributions must not silently introduce mutation of monitored Unraid, storage, container, service, or network resources. Unknown or stale telemetry remains explicit, authentication fails closed, and runtime containers retain their documented least-privilege boundaries. + +Never commit live `.env` files, production credentials, private backups, unredacted production data, or operator-specific infrastructure evidence. Agent instructions and engineering evidence retained in the canonical private repository are development context, not executable production authority; public source archives exclude that context through `.gitattributes`. diff --git a/apps/web/index.html b/apps/web/index.html new file mode 100644 index 0000000..8f3c26b --- /dev/null +++ b/apps/web/index.html @@ -0,0 +1,14 @@ + + + + + + + + ITWorx Pulse + + +
+ + + diff --git a/apps/web/package.json b/apps/web/package.json new file mode 100644 index 0000000..7d17800 --- /dev/null +++ b/apps/web/package.json @@ -0,0 +1,35 @@ +{ + "name": "@itworx/pulse-web", + "private": true, + "version": "1.5.0", + "type": "module", + "scripts": { + "build": "vite build", + "dev": "vite", + "lint": "tsc --noEmit", + "typecheck": "tsc --noEmit", + "test": "vitest run", + "test:coverage": "vitest run --coverage", + "test:e2e": "playwright test" + }, + "dependencies": { + "react": "19.2.8", + "react-dom": "19.2.8" + }, + "devDependencies": { + "@axe-core/playwright": "^4.12.1", + "@playwright/test": "^1.62.1", + "@testing-library/jest-dom": "^7.0.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.3", + "@types/node": "^26.2.0", + "@types/react": "19.2.18", + "@types/react-dom": "19.2.4", + "@vitejs/plugin-react": "6.0.5", + "@vitest/coverage-v8": "^4.1.10", + "jsdom": "^30.0.1", + "typescript": "7.0.2", + "vite": "8.2.0", + "vitest": "^4.1.10" + } +} diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts new file mode 100644 index 0000000..6a313ef --- /dev/null +++ b/apps/web/playwright.config.ts @@ -0,0 +1,33 @@ +import { defineConfig, devices } from '@playwright/test'; + +const realStackBaseURL = process.env.PULSE_E2E_REAL_BASE_URL; +const localWebPort = process.env.PULSE_E2E_WEB_PORT || '4173'; +const localBaseURL = `http://127.0.0.1:${localWebPort}`; + +export default defineConfig({ + testDir: './tests/e2e', + outputDir: '../../test-results/playwright', + reporter: [['list'], ['html', { outputFolder: '../../playwright-report', open: 'never' }]], + timeout: 30_000, + expect: { timeout: 5_000 }, + fullyParallel: true, + forbidOnly: Boolean(process.env.CI), + retries: process.env.CI ? 1 : 0, + use: { + baseURL: realStackBaseURL || localBaseURL, + trace: 'retain-on-failure', + screenshot: 'only-on-failure', + }, + webServer: realStackBaseURL ? undefined : { + command: `pnpm dev --host 127.0.0.1 --port ${localWebPort} --strictPort`, + url: `${localBaseURL}/healthz`, + reuseExistingServer: false, + timeout: 120_000, + }, + projects: [ + { name: 'desktop-chromium', use: { ...devices['Desktop Chrome'], viewport: { width: 1440, height: 900 } } }, + { name: 'tablet-chromium', use: { ...devices['Desktop Chrome'], viewport: { width: 1024, height: 768 } } }, + { name: 'mobile-chromium', use: { ...devices['Pixel 7'], viewport: { width: 390, height: 844 } } }, + { name: 'wallboard-chromium', use: { ...devices['Desktop Chrome'], viewport: { width: 1920, height: 1080 } } }, + ], +}); diff --git a/apps/web/public/pulse-icon.svg b/apps/web/public/pulse-icon.svg new file mode 100644 index 0000000..f964baf --- /dev/null +++ b/apps/web/public/pulse-icon.svg @@ -0,0 +1,21 @@ + + ITWorx Pulse + Een blauwe Pulse-letter P met een operationele signaalgolf. + + + + + + + + + + + + + + + + + + diff --git a/apps/web/src/AlertControlsPanel.tsx b/apps/web/src/AlertControlsPanel.tsx new file mode 100644 index 0000000..017217d --- /dev/null +++ b/apps/web/src/AlertControlsPanel.tsx @@ -0,0 +1,65 @@ +import { useEffect, useState } from 'react'; +import { copy } from './copy'; + +type Matcher = { ruleIds?: string[]; entityIds?: string[]; entityTypes?: string[]; severities?: string[]; labels?: Record }; +type Silence = { id: string; name: string; reason: string; owner: string; matchers: Matcher; startsAt: string; expiresAt: string; state: string; revision: number }; +type Maintenance = { id: string; name: string; reason: string; selector: Matcher; startsAt: string; endsAt: string; state: string; revision: number }; +type ControlForm = { name: string; reason: string; matcher: string; startsAt: string; expiresAt: string }; + +function localDate(offsetHours: number) { const date = new Date(Date.now() + offsetHours * 3600000); const local = new Date(date.getTime() - date.getTimezoneOffset() * 60000); return local.toISOString().slice(0, 16); } +function toUTC(value: string) { return new Date(value).toISOString(); } +function matcherFor(value: string, key: 'severity' | 'entityType'): Matcher { const values = value.split(',').map((item) => item.trim()).filter(Boolean); return key === 'severity' ? { severities: values } : { entityTypes: values }; } +function stateLabel(value: string) { return value === 'active' ? copy.alerts.controlActive : value === 'scheduled' ? copy.alerts.controlScheduled : value === 'expired' ? copy.alerts.controlExpired : copy.alerts.controlRevoked; } + +export function AlertControlsPanel() { + const [silences, setSilences] = useState([]); + const [maintenance, setMaintenance] = useState([]); + const [silenceForm, setSilenceForm] = useState({ name: '', reason: '', matcher: 'critical', startsAt: localDate(0), expiresAt: localDate(1) }); + const [maintenanceForm, setMaintenanceForm] = useState({ name: '', reason: '', matcher: 'host', startsAt: localDate(0), expiresAt: localDate(1) }); + const [preview, setPreview] = useState(''); + const [message, setMessage] = useState(''); + + async function load() { + const [silenceResponse, maintenanceResponse] = await Promise.all([fetch('/api/v1/alert-silences?limit=100'), fetch('/api/v1/maintenance-windows?limit=100')]); + if (silenceResponse.ok) setSilences(((await silenceResponse.json()) as { items?: Silence[] }).items ?? []); + if (maintenanceResponse.ok) setMaintenance(((await maintenanceResponse.json()) as { items?: Maintenance[] }).items ?? []); + } + useEffect(() => { void load(); }, []); + + async function createSilence() { + setMessage(''); + const response = await fetch('/api/v1/alert-silences', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: silenceForm.name, reason: silenceForm.reason, owner: 'current-user', matchers: matcherFor(silenceForm.matcher, 'severity'), startsAt: toUTC(silenceForm.startsAt), expiresAt: toUTC(silenceForm.expiresAt) }) }); + if (!response.ok) { setMessage(copy.alerts.controlSaveError); return; } + setSilenceForm({ ...silenceForm, name: '', reason: '' }); setMessage(copy.alerts.controlSaved); await load(); + } + async function createMaintenance() { + setMessage(''); + const response = await fetch('/api/v1/maintenance-windows', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: maintenanceForm.name, reason: maintenanceForm.reason, selector: matcherFor(maintenanceForm.matcher, 'entityType'), startsAt: toUTC(maintenanceForm.startsAt), endsAt: toUTC(maintenanceForm.expiresAt) }) }); + if (!response.ok) { setMessage(copy.alerts.controlSaveError); return; } + setMaintenanceForm({ ...maintenanceForm, name: '', reason: '' }); setMessage(copy.alerts.controlSaved); await load(); + } + async function revoke(kind: 'silence' | 'maintenance', id: string, revision: number) { + if (!window.confirm(copy.alerts.confirmRevoke)) return; + const endpoint = kind === 'silence' ? '/api/v1/alert-silences/' : '/api/v1/maintenance-windows/'; + const response = await fetch(endpoint + encodeURIComponent(id) + '/revoke?revision=' + revision, { method: 'POST' }); + if (!response.ok) { setMessage(copy.alerts.controlSaveError); return; } + await load(); + } + async function previewMatcher() { + const response = await fetch('/api/v1/alert-silences/preview', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ matcher: matcherFor(silenceForm.matcher, 'severity'), signals: [{ instanceId: 'preview-signal', severity: silenceForm.matcher.split(',')[0].trim() }] }) }); + if (!response.ok) { setPreview(copy.alerts.controlPreviewError); return; } + const data = await response.json() as { preview?: { matchedCount?: number } }; + setPreview(copy.alerts.controlPreview + ': ' + String(data.preview?.matchedCount ?? 0)); + } + + return
+

{copy.alerts.controls}

{copy.alerts.controlsTitle}

{copy.alerts.controlHistory}
+

{copy.alerts.controlsIntro}

+
+
{ event.preventDefault(); void createSilence(); }}>

{copy.alerts.silenceTitle}

{preview && {preview}}
+
{ event.preventDefault(); void createMaintenance(); }}>

{copy.alerts.maintenanceTitle}

+
+ {message &&

{message}

} +

{copy.alerts.silenceHistory}

{silences.length === 0 ?

{copy.alerts.noControls}

:
    {silences.map((item) =>
  • {item.name}{stateLabel(item.state)} · {item.reason}{item.state === 'active' && }
  • )}
}

{copy.alerts.maintenanceHistory}

{maintenance.length === 0 ?

{copy.alerts.noControls}

:
    {maintenance.map((item) =>
  • {item.name}{stateLabel(item.state)} · {item.reason}{item.state === 'active' && }
  • )}
}
+
; +} diff --git a/apps/web/src/AlertOperationsPanel.tsx b/apps/web/src/AlertOperationsPanel.tsx new file mode 100644 index 0000000..51f28f1 --- /dev/null +++ b/apps/web/src/AlertOperationsPanel.tsx @@ -0,0 +1,96 @@ +import { useEffect, useMemo, useState } from 'react'; + +import { copy } from './copy'; +import { plural, presentReason, presentStatus } from './presentation'; + +type AlertItem = { id: string; state: string; retainedState: string; ruleName: string; severity: string; entityName?: string; reason: string; revision: number; acknowledgedBy?: string; updatedAt?: string; occurrences?: Array<{ eventType: string; from: string; to: string; observedAt: string; reason: string }> }; +type AlertView = 'active' | 'critical' | 'acknowledged'; + +const stateOrder: Record = { firing: 0, pending: 1, acknowledged: 2, silenced: 3, suppressed: 4, resolved: 5 }; +const severityOrder: Record = { critical: 0, degraded: 1, attention: 2, warning: 3, info: 4, unknown: 5 }; + +function alertTone(severity: string): 'critical' | 'attention' | 'ready' | 'unknown' { + if (severity === 'critical') return 'critical'; + if (severity === 'degraded' || severity === 'attention' || severity === 'warning') return 'attention'; + if (severity === 'info') return 'ready'; + return 'unknown'; +} + +function isActive(item: AlertItem): boolean { return item.state !== 'resolved'; } + +export function AlertOperationsPanel() { + const [items, setItems] = useState([]); + const [selected, setSelected] = useState(null); + const [message, setMessage] = useState(''); + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [view, setView] = useState('active'); + + async function load(signal?: AbortSignal) { + try { + const response = await fetch('/api/v1/alerts?limit=100', { signal }); + if (!response.ok) throw new Error('alerts'); + setItems(((await response.json()) as { items?: AlertItem[] }).items ?? []); + setState('ready'); + } catch (error) { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState('error'); + } + } + + useEffect(() => { + const controller = new AbortController(); + void load(controller.signal); + return () => controller.abort(); + }, []); + + const ordered = useMemo(() => items.slice().sort((left, right) => + (severityOrder[left.severity] ?? 9) - (severityOrder[right.severity] ?? 9) + || (stateOrder[left.state] ?? 9) - (stateOrder[right.state] ?? 9) + || (right.updatedAt ?? '').localeCompare(left.updatedAt ?? '') + || left.ruleName.localeCompare(right.ruleName, 'nl-BE') + || left.id.localeCompare(right.id)), [items]); + const activeCount = items.filter(isActive).length; + const criticalCount = items.filter((item) => isActive(item) && item.severity === 'critical').length; + const acknowledgedCount = items.filter((item) => item.state === 'acknowledged').length; + const filtered = ordered.filter((item) => view === 'critical' ? isActive(item) && item.severity === 'critical' : view === 'acknowledged' ? item.state === 'acknowledged' : isActive(item)); + const visible = filtered.slice(0, 20); + + async function choose(item: AlertItem) { + const response = await fetch('/api/v1/alerts/' + encodeURIComponent(item.id) + '?occurrenceLimit=50'); + if (response.ok) setSelected(((await response.json()) as { alert: AlertItem }).alert); + } + + async function operate(item: AlertItem, acknowledge: boolean) { + if (!window.confirm(acknowledge ? copy.alerts.confirmAcknowledge : copy.alerts.confirmUnacknowledge)) return; + setMessage(''); + const response = await fetch('/api/v1/alerts/' + encodeURIComponent(item.id) + '/' + (acknowledge ? 'acknowledge' : 'unacknowledge'), { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'If-Match': String(item.revision), 'Idempotency-Key': (globalThis.crypto?.randomUUID?.() ?? String(Date.now())) }, + body: '{}', + }); + if (!response.ok) { setMessage(copy.alerts.operationError); return; } + setMessage(copy.alerts.operationSaved); + await load(); + if (selected?.id === item.id) await choose(item); + } + + return
+
+ + + +
+
+

{copy.alerts.operations}

{copy.alerts.alertList}

{copy.alerts.historyPreserved}
+

{copy.alerts.operationsIntro}

+ {state === 'loading' ?

{copy.alerts.operationsLoading}

: state === 'error' ?

{copy.alerts.operationsError}

: visible.length === 0 ?

{copy.alerts.noActiveAlerts}

:
    {visible.map((item) =>
  • + {presentStatus(item.severity)} + + +
  • )}
} + {filtered.length > visible.length &&

{copy.alerts.resultLimit.replace('{count}', String(visible.length)).replace('{total}', String(filtered.length))}

} + {selected &&

{selected.ruleName}

{presentStatus(selected.state)} · {presentReason(selected.reason)}

{selected.occurrences?.length ?? 0} {plural(selected.occurrences?.length ?? 0, copy.alerts.occurrence, copy.alerts.occurrences)} · {copy.alerts.revision}: {selected.revision}
} + {message &&

{message}

} +
+
; +} diff --git a/apps/web/src/AlertRulesPage.tsx b/apps/web/src/AlertRulesPage.tsx new file mode 100644 index 0000000..d2fbd69 --- /dev/null +++ b/apps/web/src/AlertRulesPage.tsx @@ -0,0 +1,261 @@ +import { useEffect, useMemo, useState } from 'react'; +import { copy } from './copy'; +import { AlertControlsPanel } from './AlertControlsPanel'; +import { AlertOperationsPanel } from './AlertOperationsPanel'; +import { queryValue, replaceListQuery } from './listQuery'; +import { presentMetric, presentReason, presentStatus, presentUnit } from './presentation'; + +type InputType = 'metric' | 'entity-status' | 'event' | 'datasource-health'; +type Condition = { inputType: InputType; metric?: string; operator: string; threshold: number | string | null; recoveryThreshold?: number | null; aggregation?: string; windowSeconds?: number }; +type Rule = { + id: string; schemaVersion: number; name: string; enabled: boolean; severity: string; scope: Record; + condition: Condition; evaluationIntervalSeconds: number; pendingSeconds: number; resolveSeconds: number; cooldownSeconds?: number; + unknownBehavior: string; groupBy: string[]; suppressWhen: string[]; message: { titleKey: string; bodyKey: string }; + revision: number; currentVersion: number; updatedAt?: string; +}; +type DraftRule = Omit; +type Preview = { wouldFire: boolean; state: string; reason: string }; +type MetricDefinition = { semanticName: string; unit: string; defaultAggregation?: string }; + +const causes = [ + { value: 'host.unreachable', label: copy.alerts.causeHost }, + { value: 'dns.failure', label: copy.alerts.causeDns }, + { value: 'source.unavailable', label: copy.alerts.causeSource }, +]; +const orderedOperators = new Set(['>', '>=', '<', '<=']); +const supportedOperators = new Set(['>', '>=', '<', '<=', '==', '!=', 'matches', 'absent']); +const alertSections = ['operations', 'rules', 'controls'] as const; +type AlertSection = typeof alertSections[number]; + +function newRule(): DraftRule { + return { + id: globalThis.crypto?.randomUUID?.() ?? '00000000-0000-4000-8000-000000000000', + schemaVersion: 1, name: '', enabled: false, severity: 'attention', scope: {}, + condition: { inputType: 'metric', metric: '', operator: '>', threshold: 80, aggregation: 'avg', windowSeconds: 60 }, + evaluationIntervalSeconds: 30, pendingSeconds: 60, resolveSeconds: 120, cooldownSeconds: 300, + unknownBehavior: 'retain-firing-as-unknown', groupBy: [], suppressWhen: [], + message: { titleKey: 'alerts.rule.title', bodyKey: 'alerts.rule.body' }, + }; +} + +export function AlertRulesPage() { + const [section, setSection] = useState(() => queryValue('section', alertSections, 'operations') as AlertSection); + const [rules, setRules] = useState([]); + const [draft, setDraft] = useState(newRule); + const [selectedId, setSelectedId] = useState(null); + const [state, setState] = useState<'loading' | 'ready' | 'error' | 'unauthorized'>('loading'); + const [message, setMessage] = useState(''); + const [preview, setPreview] = useState(null); + const [previewValue, setPreviewValue] = useState('90'); + const [busy, setBusy] = useState(false); + const [metrics, setMetrics] = useState([]); + const [metricState, setMetricState] = useState<'loading' | 'ready' | 'error'>('loading'); + + const selected = useMemo(() => rules.find((rule) => rule.id === selectedId), [rules, selectedId]); + + useEffect(() => { + const controller = new AbortController(); + fetch('/api/v1/alert-rules?limit=100', { signal: controller.signal }) + .then((response) => { + if (response.status === 401 || response.status === 403) { setState('unauthorized'); throw new Error('unauthorized'); } + if (!response.ok) throw new Error('alert-rules'); + return response.json() as Promise<{ items?: Rule[] }>; + }) + .then((data) => { + const items = data.items ?? []; + setRules(items); + if (items[0]) { setSelectedId(items[0].id); setDraft(toDraft(items[0])); } + setState('ready'); + }) + .catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + if (error instanceof Error && error.message === 'unauthorized') return; + setState('error'); + }); + return () => controller.abort(); + }, []); + + useEffect(() => { + replaceListQuery({ section: section === 'operations' ? '' : section }); + }, [section]); + + useEffect(() => { + const controller = new AbortController(); + fetch('/api/v1/metrics/catalog', { signal: controller.signal }) + .then((response) => { + if (!response.ok) throw new Error('metric-catalog'); + return response.json() as Promise<{ metrics?: MetricDefinition[] }>; + }) + .then((data) => { + setMetrics((data.metrics ?? []).slice().sort((a, b) => presentMetric(a.semanticName).localeCompare(presentMetric(b.semanticName), 'nl-BE'))); + setMetricState('ready'); + }) + .catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setMetricState('error'); + }); + return () => controller.abort(); + }, []); + + function chooseRule(rule: Rule) { + setSelectedId(rule.id); + setDraft(toDraft(rule)); + setPreview(null); + setMessage(''); + } + + function updateField(key: K, value: DraftRule[K]) { + setDraft((current) => ({ ...current, [key]: value })); + } + + function updateCondition(key: K, value: Condition[K]) { + setDraft((current) => ({ ...current, condition: { ...current.condition, [key]: value } })); + } + + function chooseInputType(inputType: InputType) { + const presets: Record = { + metric: { inputType, metric: '', operator: '>', threshold: 80, recoveryThreshold: null, aggregation: 'avg', windowSeconds: 60 }, + event: { inputType, operator: '>=', threshold: 3, recoveryThreshold: null, aggregation: 'count', windowSeconds: 900 }, + 'entity-status': { inputType, operator: '==', threshold: 'degraded', recoveryThreshold: null, aggregation: 'none', windowSeconds: 60 }, + 'datasource-health': { inputType, operator: '==', threshold: 'stale', recoveryThreshold: null, aggregation: 'none', windowSeconds: 120 }, + }; + setDraft((current) => ({ ...current, condition: presets[inputType] })); + } + + function chooseOperator(operator: string) { + setDraft((current) => ({ + ...current, + condition: { + ...current.condition, + operator, + threshold: operator === 'absent' ? null : operator === 'matches' ? String(current.condition.threshold ?? '') : current.condition.threshold, + recoveryThreshold: orderedOperators.has(operator) ? current.condition.recoveryThreshold : null, + }, + })); + } + + async function save() { + const validation = validateDraft(draft, metrics); + if (validation) { setMessage(validation); return; } + setBusy(true); setMessage(''); + try { + const selectedRule = selectedId ? rules.find((rule) => rule.id === selectedId) : undefined; + const response = await fetch(selectedRule ? '/api/v1/alert-rules/' + encodeURIComponent(selectedRule.id) : '/api/v1/alert-rules', { + method: selectedRule ? 'PUT' : 'POST', + headers: { 'Content-Type': 'application/json', ...(selectedRule ? { 'If-Match': String(selectedRule.revision) } : {}) }, + body: JSON.stringify(draft), + }); + if (!response.ok) throw new Error(response.status === 409 ? copy.alerts.conflict : copy.alerts.saveError); + const data = await response.json() as { rule: Rule }; + setRules((current) => selectedRule ? current.map((rule) => rule.id === data.rule.id ? data.rule : rule) : [data.rule, ...current]); + setSelectedId(data.rule.id); + setDraft(toDraft(data.rule)); + setMessage(copy.alerts.saved); + } catch (error) { setMessage(error instanceof Error ? error.message : copy.alerts.saveError); } + finally { setBusy(false); } + } + + function toggleCause(value: string, checked: boolean) { + updateField('suppressWhen', checked + ? [...new Set([...draft.suppressWhen, value])] + : draft.suppressWhen.filter((cause) => cause !== value)); + } + + async function toggle(enabled: boolean) { + if (!selected) return; + if (!window.confirm(enabled ? copy.alerts.confirmRuleEnable : copy.alerts.confirmRuleDisable)) return; + setBusy(true); setMessage(''); + try { + const response = await fetch('/api/v1/alert-rules/' + encodeURIComponent(selected.id) + '/' + (enabled ? 'enable' : 'disable'), { + method: 'POST', headers: { 'If-Match': String(selected.revision) }, + }); + if (!response.ok) throw new Error(response.status === 409 ? copy.alerts.conflict : copy.alerts.toggleError); + const data = await response.json() as { rule: Rule }; + setRules((current) => current.map((rule) => rule.id === data.rule.id ? data.rule : rule)); + setDraft(toDraft(data.rule)); + setMessage(copy.alerts.stateSaved); + } catch (error) { setMessage(error instanceof Error ? error.message : copy.alerts.toggleError); } + finally { setBusy(false); } + } + + async function testPreview() { + setBusy(true); setMessage(''); + try { + const response = await fetch('/api/v1/alert-rules/' + encodeURIComponent(draft.id) + '/test', { + method: 'POST', headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ rule: draft, value: parsePreviewValue(previewValue) }), + }); + if (!response.ok) throw new Error(copy.alerts.previewError); + const data = await response.json() as { preview: Preview }; + setPreview(data.preview); + } catch (error) { setMessage(error instanceof Error ? error.message : copy.alerts.previewError); } + finally { setBusy(false); } + } + + if (state === 'loading') return
; + if (state === 'unauthorized') return

{copy.alerts.unauthorizedTitle}

{copy.alerts.unauthorizedDetail}

; + if (state === 'error') return

{copy.alerts.errorTitle}

{copy.alerts.errorDetail}

; + + return <>

{copy.alerts.eyebrow}

{copy.alerts.title}

{copy.alerts.intro}

+ + {section === 'operations' && } + {section === 'rules' &&
+
+

{copy.alerts.rules}

{copy.alerts.ruleList}

+ {rules.length === 0 ?

{copy.alerts.noRules}

:
    {rules.map((rule) =>
  • {rule.enabled ? copy.alerts.enabled : copy.alerts.disabled}
  • )}
} +
+
+

{copy.alerts.editor}

{selected ? copy.alerts.editRule : copy.alerts.createRule}

{selected && v{selected.currentVersion}}
+
+ + + + {draft.condition.inputType === 'metric' && } + + {orderedOperators.has(draft.condition.operator) && } + + + +
{copy.alerts.suppressWhen}{causes.map((cause) => )}{copy.alerts.suppressWhenHelp}
+ +
{copy.alerts.technicalDetails}
{copy.alerts.titleKey}
{draft.message.titleKey}
{copy.alerts.bodyKey}
{draft.message.bodyKey}
{draft.suppressWhen.map((cause) =>
{copy.alerts.suppressWhen}
{cause}
)}
+
+
{selected && }
+ {message &&

{message}

} +

{copy.alerts.preview}

{copy.alerts.previewTitle}

{copy.alerts.previewDetail}

{preview &&

{presentStatus(preview.state)}: {presentReason(preview.reason)}

}
+
+
} + {section === 'controls' && } + ; +} + +function toDraft(rule: Rule): DraftRule { + const { revision: _revision, currentVersion: _version, updatedAt: _updatedAt, ...draft } = rule; + return { ...draft, cooldownSeconds: rule.cooldownSeconds ?? 0, condition: { ...draft.condition, recoveryThreshold: rule.condition.recoveryThreshold ?? null } }; +} + +export function validateDraft(draft: DraftRule, metrics: MetricDefinition[]): string { + if (!draft.name.trim()) return copy.alerts.invalidName; + if (draft.condition.inputType === 'metric' && (!draft.condition.metric || !metrics.some((metric) => metric.semanticName === draft.condition.metric))) return copy.alerts.invalidMetric; + if (draft.condition.inputType !== 'metric' && draft.condition.metric) return copy.alerts.invalidMetric; + if (!supportedOperators.has(draft.condition.operator)) return copy.alerts.invalidThreshold; + const threshold = draft.condition.threshold; + if (draft.condition.operator === 'absent' ? threshold !== null : orderedOperators.has(draft.condition.operator) ? typeof threshold !== 'number' || !Number.isFinite(threshold) : (typeof threshold !== 'number' || !Number.isFinite(threshold)) && (typeof threshold !== 'string' || !threshold.trim() || threshold.length > 160)) return copy.alerts.invalidThreshold; + if (draft.condition.operator === 'matches') { + try { new RegExp(String(threshold)); } catch { return copy.alerts.invalidThreshold; } + } + const recovery = draft.condition.recoveryThreshold; + if (recovery != null && (typeof threshold !== 'number' || !Number.isFinite(recovery) || !orderedOperators.has(draft.condition.operator) || ((draft.condition.operator === '>' || draft.condition.operator === '>=') && recovery >= threshold) || ((draft.condition.operator === '<' || draft.condition.operator === '<=') && recovery <= threshold))) return copy.alerts.invalidThreshold; + const times = [draft.evaluationIntervalSeconds, draft.pendingSeconds, draft.resolveSeconds, draft.cooldownSeconds ?? 0]; + if (draft.evaluationIntervalSeconds < 5 || draft.evaluationIntervalSeconds > 3600 || times.some((value) => !Number.isInteger(value) || value < 0 || value > 2_592_000)) return copy.alerts.invalidTiming; + return ''; +} + +function parsePreviewValue(value: string): number | string { + const numeric = Number(value); + return value.trim() !== '' && Number.isFinite(numeric) ? numeric : value; +} diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx new file mode 100644 index 0000000..fdd50dd --- /dev/null +++ b/apps/web/src/App.tsx @@ -0,0 +1,807 @@ +import { Component, Suspense, lazy, type CSSProperties, type ErrorInfo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { MetricWidget, metricStatus, RankedListWidget, StatusGridWidget, type MetricWidgetProps, type RankedListItem, type StatusGridItem } from './MetricWidgets'; +import { DashboardRuntimeWidget, type RuntimeState } from './DashboardRuntimeWidget'; +import { copy } from './copy'; +import { routeFromLocation, type RoutePath } from './routes'; +import { HostPage } from './HostPage'; +import { ArrayPage } from './ArrayPage'; +import { DiskDetailPage, DiskPage } from './DiskPage'; +import { PoolPage } from './PoolPage'; +import { SharePage } from './SharePage'; +import { StoragePage } from './StoragePage'; +import { CapacityPage } from './CapacityPage'; +import { StorageMapWidget, TemperatureHeatmap, type HeatmapPoint, type StorageMapNode } from './StorageVisuals'; +import { ContainerDetailPage, ContainerPage } from './ContainerPage'; +import { ApplicationPage } from './ApplicationPage'; +import { ServicePage } from './ServicePage'; +import type { TopologyData } from './TopologyPage'; +import { NetworkPage, NetworkHealthWidget, type NetworkData } from './NetworkPage'; +import { IncidentPage } from './IncidentPage'; +import { OnboardingPage } from './OnboardingPage'; +import { SystemStatusPage } from './SystemStatusPage'; +import { InventoryPage } from './InventoryPage'; +import { EventsPage } from './EventsPage'; +import { NotFoundPage } from './NotFoundPage'; +import { formatDateTime } from './locale'; +import { installSessionWatcher, onUnauthenticated } from './auth'; +import { AuthNoticeBanner, SignInButton } from './SignIn'; +import { aggregateStatus, refreshSystemStatus, statusProblems, useSystemStatus } from './systemStatus'; +import { operationalStorageState, presentComponent, presentReason, presentStatus } from './presentation'; +import { wallboardColumns, wallboardPlacement, wallboardSlideIndex } from './wallboardLayout'; +import { OperationalSignalPath, type OperationalSignalStage } from './OperationalSignalPath'; +import { containerSignalTone, signalToneFromState, signalToneRank, sourceSignalTone, worstSignalTone, type SignalTone } from './overviewSignals'; + +// Heavy, rarely-used surfaces. The wallboard and mobile personas never execute +// the editor stack, the alert-rule editor, the topology graph or the process +// explorer, so those stay out of the initial chunk (FRONTEND_STANDARDS "Charts"). +const DashboardEditor = lazy(() => import('./DashboardEditor').then((module) => ({ default: module.DashboardEditor }))); +const AlertRulesPage = lazy(() => import('./AlertRulesPage').then((module) => ({ default: module.AlertRulesPage }))); +const TopologyPage = lazy(() => import('./TopologyPage').then((module) => ({ default: module.TopologyPage }))); +const TopologyWidget = lazy(() => import('./TopologyPage').then((module) => ({ default: module.TopologyWidget }))); +const ProcessPage = lazy(() => import('./ProcessPage').then((module) => ({ default: module.ProcessPage }))); + +const navigation = [ + { path: '/', label: copy.navigation.overview, icon: '⌂', group: copy.navigation.groups.command }, + { path: '/dashboards', label: copy.navigation.dashboards, icon: '▦', group: copy.navigation.groups.command }, + { path: '/host', label: copy.navigation.host, icon: '▣', group: copy.navigation.groups.infrastructure }, + { path: '/array', label: copy.navigation.array, icon: '▥', group: copy.navigation.groups.infrastructure }, + { path: '/disks', label: copy.navigation.disks, icon: '◉', group: copy.navigation.groups.infrastructure }, + { path: '/pools', label: copy.navigation.pools, icon: '◫', group: copy.navigation.groups.infrastructure }, + { path: '/shares', label: copy.navigation.shares, icon: '⇄', group: copy.navigation.groups.infrastructure }, + { path: '/storage', label: copy.navigation.storage, icon: '▤', group: copy.navigation.groups.infrastructure }, + { path: '/capacity', label: copy.navigation.capacity, icon: '⌁', group: copy.navigation.groups.infrastructure }, + { path: '/network', label: copy.navigation.network, icon: '⌘', group: copy.navigation.groups.infrastructure }, + { path: '/processes', label: copy.navigation.processes, icon: '≋', group: copy.navigation.groups.workloads }, + { path: '/containers', label: copy.navigation.containers, icon: '⬡', group: copy.navigation.groups.workloads }, + { path: '/applications', label: copy.navigation.applications, icon: '◆', group: copy.navigation.groups.workloads }, + { path: '/services', label: copy.navigation.services, icon: '◉', group: copy.navigation.groups.services }, + { path: '/topology', label: copy.navigation.topology, icon: '⌬', group: copy.navigation.groups.services }, + { path: '/alerts', label: copy.navigation.alerts, icon: '!', group: copy.navigation.groups.response }, + { path: '/events', label: copy.navigation.events, icon: '≡', group: copy.navigation.groups.response }, + { path: '/incidents', label: copy.navigation.incidents, icon: '△', group: copy.navigation.groups.response }, + { path: '/inventory', label: copy.navigation.inventory, icon: '▥', group: copy.navigation.groups.manage }, + { path: '/wallboard', label: copy.navigation.wallboard, icon: '▰', group: copy.navigation.groups.manage }, + { path: '/settings', label: copy.navigation.settings, icon: '⚙', group: copy.navigation.groups.manage }, + { path: '/status', label: copy.navigation.status, icon: '♥', group: copy.navigation.groups.manage }, + { path: '/onboarding', label: copy.navigation.onboarding, icon: '→', group: copy.navigation.groups.manage }, +] as const satisfies ReadonlyArray<{ path: RoutePath; label: string; icon: string; group: string }>; + +const mobilePrimaryPaths = new Set(['/', '/incidents', '/containers', '/storage']); +const mobilePrimaryNavigation = ['/', '/incidents', '/containers', '/storage'].map((path) => navigation.find((item) => item.path === path)).filter((item): item is NavigationItem => Boolean(item)); +const mobileMoreNavigation = navigation.filter((item) => !mobilePrimaryPaths.has(item.path)); +type NavigationItem = (typeof navigation)[number]; +const navigationGroups = Array.from(new Set(navigation.map((item) => item.group))); +function NavigationLink({ item, label = item.label }: { item: NavigationItem; label?: string }) { + const active = routeFromLocation(window.location.pathname) === item.path; + return
  • { event.preventDefault(); navigate(item.path); }}>{label}
  • ; +} +function DesktopNavigation({ route }: { route: RoutePath }) { + const activeGroup = navigation.find((item) => route === item.path || (item.path !== '/' && route.startsWith(item.path + '/')))?.group ?? navigationGroups[0]; + const [openGroups, setOpenGroups] = useState>(() => new Set([navigationGroups[0], activeGroup])); + useEffect(() => setOpenGroups((current) => current.has(activeGroup) ? current : new Set([...current, activeGroup])), [activeGroup]); + return ; +} +function navigate(path: string) { + window.history.pushState({}, '', path); + window.dispatchEvent(new PopStateEvent('popstate')); +} + +function StatusBadge({ label, tone = 'unknown' }: { label: string; tone?: 'unknown' | 'ready' }) { + return {label}; +} + +function PageIntro({ eyebrow, title, intro }: { eyebrow: string; title: string; intro: string }) { + return

    {eyebrow}

    {title}

    {intro}

    ; +} + +type OverviewSource = { state?: string; freshness?: string; reason?: string }; +type OverviewHost = { identity?: { name?: string }; cpu?: { totalPercent?: number }; memory?: { utilizationPercent?: number }; source?: OverviewSource }; +type OverviewContainer = { id?: string; state?: string; health?: string; intentionalStop?: boolean }; +type OverviewPool = { id: string; name: string; state: string; capacitySeverity?: string; utilizationPercent: number }; +type OverviewService = { id: string; name: string; state: string }; +type OverviewIncident = { id: string; title: string; severity: string; startedAt: string }; +type OverviewContainerSnapshot = { source?: OverviewSource; containers?: OverviewContainer[]; total?: number; nextCursor?: string }; +type OverviewPoolSnapshot = { source?: OverviewSource; pools?: OverviewPool[]; total?: number }; +type OverviewServiceSnapshot = { capabilityState?: string; configurationState?: string; reason?: string; services?: OverviewService[]; total?: number }; +type OverviewResourceState = 'loading' | 'ready' | 'unavailable' | 'unauthorized' | 'forbidden'; +type OverviewResource = 'host' | 'containers' | 'pools' | 'services' | 'incidents'; +type OverviewData = { + host?: OverviewHost; + containers: OverviewContainer[]; + containerSource?: OverviewSource; + containerTotal: number; + containersPartial: boolean; + pools: OverviewPool[]; + poolSource?: OverviewSource; + poolTotal: number; + poolsPartial: boolean; + services: OverviewService[]; + serviceTotal: number; + servicesPartial: boolean; + serviceCapability?: string; + serviceConfiguration?: string; + incidents: OverviewIncident[]; + incidentsPartial: boolean; + resources: Record; +}; + +const loadingOverviewResources: Record = { + host: 'loading', containers: 'loading', pools: 'loading', services: 'loading', incidents: 'loading', +}; + +const overviewInitialData: OverviewData = { + containers: [], containerTotal: 0, containersPartial: false, + pools: [], poolTotal: 0, poolsPartial: false, + services: [], serviceTotal: 0, servicesPartial: false, + incidents: [], incidentsPartial: false, + resources: loadingOverviewResources, +}; + +const OVERVIEW_REFRESH_MS = 30_000; +const OVERVIEW_REQUEST_TIMEOUT_MS = 10_000; +const CONTAINER_PAGE_LIMIT = 100; +const CONTAINER_MAX_PAGES = 3; + +type ReadResult = { state: OverviewResourceState; data?: T }; + +function collectionExtent(reported: number | undefined, count: number): { total: number; partial: boolean } { + const valid = Number.isInteger(reported) && (reported ?? -1) >= count; + const total = valid ? reported as number : count; + return { total, partial: !valid || total > count }; +} + +function useOverviewData(): { data: OverviewData; refresh: () => void } { + const [data, setData] = useState(overviewInitialData); + const [generation, setGeneration] = useState(0); + const refresh = useCallback(() => { + setData((current) => ({ ...current, resources: { ...loadingOverviewResources } })); + setGeneration((current) => current + 1); + }, []); + useEffect(() => { + const controller = new AbortController(); + const read = async (url: string): Promise> => { + const requestController = new AbortController(); + const abortRequest = () => requestController.abort(); + if (controller.signal.aborted) abortRequest(); + else controller.signal.addEventListener('abort', abortRequest, { once: true }); + const timeout = window.setTimeout(abortRequest, OVERVIEW_REQUEST_TIMEOUT_MS); + try { + const response = await fetch(url, { signal: requestController.signal, cache: 'no-store' }); + if (requestController.signal.aborted) return { state: 'unavailable' }; + if (response.status === 401) return { state: 'unauthorized' }; + if (response.status === 403) return { state: 'forbidden' }; + return response.ok ? { state: 'ready', data: await response.json() as T } : { state: 'unavailable' }; + } catch { + return { state: 'unavailable' }; + } finally { + window.clearTimeout(timeout); + controller.signal.removeEventListener('abort', abortRequest); + } + }; + + const readContainers = async (): Promise> => { + const items: OverviewContainer[] = []; + const seen = new Set(); + let source: OverviewSource | undefined; + let expectedTotal: number | undefined; + let after = ''; + let complete = false; + let inconsistent = false; + for (let page = 0; page < CONTAINER_MAX_PAGES; page += 1) { + const params = new URLSearchParams({ limit: String(CONTAINER_PAGE_LIMIT), sort: 'name' }); + if (after) params.set('after', after); + const result = await read('/api/v1/containers?' + params); + if (result.state !== 'ready' || !result.data) return { state: result.state }; + const pageItems = result.data.containers ?? []; + const reportedTotal = result.data.total; + if (!Number.isInteger(reportedTotal) || (reportedTotal ?? -1) < pageItems.length) { + inconsistent = true; + } else if (expectedTotal == null) { + expectedTotal = reportedTotal as number; + } else { + if (reportedTotal !== expectedTotal) inconsistent = true; + expectedTotal = Math.max(expectedTotal, reportedTotal as number); + } + if (!source || signalToneRank[sourceSignalTone(result.data.source)] < signalToneRank[sourceSignalTone(source)]) source = result.data.source; + for (const item of pageItems) { + const id = item.id?.trim(); + if (!id) { + inconsistent = true; + items.push(item); + } else if (seen.has(id)) { + inconsistent = true; + } else { + seen.add(id); + items.push(item); + } + } + const next = result.data.nextCursor?.trim() ?? ''; + if (!next) { + complete = true; + break; + } + if (next === after) { + inconsistent = true; + break; + } + after = next; + } + const total = Math.max(expectedTotal ?? 0, items.length); + return { state: 'ready', data: { source, items, total, partial: !complete || inconsistent || items.length < total } }; + }; + + void read('/api/v1/host').then((result) => { + if (controller.signal.aborted) return; + setData((current) => ({ ...current, host: result.data, resources: { ...current.resources, host: result.state } })); + }); + void readContainers().then((result) => { + if (controller.signal.aborted) return; + setData((current) => ({ ...current, containers: result.data?.items ?? [], containerSource: result.data?.source, containerTotal: result.data?.total ?? 0, containersPartial: result.data?.partial ?? false, resources: { ...current.resources, containers: result.state } })); + }); + void read('/api/v1/pools?limit=64').then((result) => { + if (controller.signal.aborted) return; + const items = result.data?.pools ?? []; + const extent = collectionExtent(result.data?.total, items.length); + setData((current) => ({ ...current, pools: items, poolSource: result.data?.source, poolTotal: extent.total, poolsPartial: result.state === 'ready' && extent.partial, resources: { ...current.resources, pools: result.state } })); + }); + void read('/api/v1/services?limit=100').then((result) => { + if (controller.signal.aborted) return; + const items = result.data?.services ?? []; + const extent = collectionExtent(result.data?.total, items.length); + setData((current) => ({ ...current, services: items, serviceTotal: extent.total, servicesPartial: result.state === 'ready' && extent.partial, serviceCapability: result.data?.capabilityState, serviceConfiguration: result.data?.configurationState, resources: { ...current.resources, services: result.state } })); + }); + void read<{ items?: OverviewIncident[] }>('/api/v1/incidents?limit=100&status=open').then((result) => { + if (controller.signal.aborted) return; + const items = result.data?.items ?? []; + setData((current) => ({ ...current, incidents: items, incidentsPartial: result.state === 'ready' && items.length >= 100, resources: { ...current.resources, incidents: result.state } })); + }); + return () => controller.abort(); + }, [generation]); + useEffect(() => { + const timer = window.setInterval(() => { + if (document.visibilityState === 'visible') setGeneration((current) => current + 1); + }, OVERVIEW_REFRESH_MS); + return () => window.clearInterval(timer); + }, []); + return { data, refresh }; +} + +function signalResourceLabel(state: OverviewResourceState, tone: SignalTone): string { + if (state === 'loading') return copy.overview.signalPathLoading; + if (state === 'unauthorized') return copy.overview.signalPathUnauthorized; + if (state === 'forbidden') return copy.overview.signalPathForbidden; + if (state === 'unavailable') return copy.overview.signalPathUnavailable; + return presentStatus(tone === 'attention' ? 'attention' : tone); +} + +function resourceStateDetail(state: OverviewResourceState): string | undefined { + if (state === 'loading') return copy.overview.resourceLoadingDetail; + if (state === 'unauthorized') return copy.overview.resourceUnauthorizedDetail; + if (state === 'forbidden') return copy.overview.resourceForbiddenDetail; + if (state === 'unavailable') return copy.overview.resourceUnavailableDetail; + return undefined; +} + +function thresholdTone(values: Array): SignalTone { + const usable = values.filter((value): value is number => value != null && Number.isFinite(value)); + if (usable.length !== values.length) return 'unknown'; + if (usable.some((value) => value >= 95)) return 'critical'; + if (usable.some((value) => value >= 85)) return 'attention'; + return 'healthy'; +} + +function metric(value: number | undefined, suffix = '%'): string { + return value == null || !Number.isFinite(value) ? '—' : value.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + suffix; +} + +function boundedRatio(known: number, total: number, partial: boolean): string { + return `${partial ? '≥' : ''}${known}/${total}`; +} + +function signalCollectionLabel(state: OverviewResourceState, tone: SignalTone, options: { partial?: boolean; notConfigured?: boolean; emptyLabel?: string } = {}): string { + if (state !== 'ready') return signalResourceLabel(state, tone); + if (tone === 'critical' || tone === 'attention' || tone === 'stale') return presentStatus(tone); + if (options.notConfigured) return copy.overview.signalPathNotConfigured; + if (options.partial) return copy.overview.signalPathPartial; + if (options.emptyLabel) return options.emptyLabel; + return presentStatus(tone); +} + +function OverviewPage() { + const snapshot = useSystemStatus(); + const status = aggregateStatus(snapshot); + const { data: overview, refresh: refreshOverview } = useOverviewData(); + const resourcesLoading = snapshot.state === 'loading' || Object.values(overview.resources).some((state) => state === 'loading'); + const overviewNeedsAuthentication = snapshot.state === 'unauthorized' || Object.values(overview.resources).some((state) => state === 'unauthorized'); + const systemResourceState: OverviewResourceState = snapshot.state === 'ready' ? 'ready' : snapshot.state === 'loading' ? 'loading' : snapshot.state === 'unauthorized' ? 'unauthorized' : snapshot.state === 'forbidden' ? 'forbidden' : 'unavailable'; + const poolRank: Record = { critical: 0, faulted: 0, degraded: 1, attention: 2, unknown: 3 }; + const poolProblems = (overview.resources.pools === 'ready' && sourceSignalTone(overview.poolSource) === 'healthy' ? overview.pools : []) + .map((pool) => ({ pool, state: operationalStorageState(pool.state, pool.capacitySeverity) })) + .filter(({ state }) => state !== 'healthy' && state !== 'normal') + .sort((a, b) => (poolRank[a.state] ?? 4) - (poolRank[b.state] ?? 4)) + .map(({ pool, state }) => ({ id: 'pool:' + pool.id, label: `${pool.name}: ${presentStatus(state)}`, reason: state === 'critical' || state === 'faulted' ? copy.overview.poolCapacityCritical : state === 'attention' ? copy.overview.poolCapacityAttention : presentReason('source_health_unknown') })); + const resourceLabels: Record = { host: copy.navigation.host, containers: copy.overview.signalWorkloads, pools: copy.overview.signalStorage, services: copy.navigation.services, incidents: copy.overview.signalIncidents }; + const resourceProblems = (Object.keys(overview.resources) as OverviewResource[]).flatMap((resource) => { + const state = overview.resources[resource]; + if (state !== 'unavailable' && state !== 'unauthorized' && state !== 'forbidden') return []; + return [{ id: `resource:${resource}`, label: `${resourceLabels[resource]}: ${signalResourceLabel(state, 'unknown')}`, reason: resourceStateDetail(state) ?? copy.overview.resourceUnavailableDetail }]; + }); + const systemProblems = systemResourceState === 'ready' || systemResourceState === 'loading' ? [] : [{ id: 'resource:system-status', label: `${copy.overview.sources}: ${signalResourceLabel(systemResourceState, 'unknown')}`, reason: resourceStateDetail(systemResourceState) ?? copy.overview.resourceUnavailableDetail }]; + const partialProblems: Array<{ id: string; label: string; reason: string }> = []; + if (overview.containersPartial) partialProblems.push({ id: 'partial:containers', label: `${copy.overview.signalWorkloads}: ${copy.overview.signalPathPartial}`, reason: copy.overview.resourcePartialDetail }); + if (overview.poolsPartial) partialProblems.push({ id: 'partial:pools', label: `${copy.overview.signalStorage}: ${copy.overview.signalPathPartial}`, reason: copy.overview.resourcePartialDetail }); + if (overview.servicesPartial) partialProblems.push({ id: 'partial:services', label: `${copy.navigation.services}: ${copy.overview.signalPathPartial}`, reason: copy.overview.resourcePartialDetail }); + if (overview.incidentsPartial) partialProblems.push({ id: 'partial:incidents', label: `${copy.overview.signalIncidents}: ${copy.overview.signalPathPartial}`, reason: copy.overview.resourcePartialDetail }); + const problems = [...systemProblems, ...resourceProblems, ...partialProblems, ...poolProblems, ...statusProblems(snapshot.status)].slice(0, 10); + const poolUsage = overview.pools.length ? Math.max(...overview.pools.map((pool) => pool.utilizationPercent)) : undefined; + const runningContainers = overview.containers.filter((item) => item.state?.toLowerCase() === 'running').length; + const availableServices = overview.services.filter((item) => item.state?.toLowerCase() === 'up').length; + const sourceLags = snapshot.status?.sourceLag ?? []; + const sourceTones = sourceLags.map((lag) => signalToneFromState(lag.state)); + const healthySources = sourceTones.filter((tone) => tone === 'healthy').length; + const sourceTone = snapshot.state !== 'ready' || sourceTones.length === 0 ? 'unknown' : status.stale ? 'stale' : worstSignalTone(sourceTones); + const hostSourceTone = sourceSignalTone(overview.host?.source); + const hostTone = overview.resources.host !== 'ready' || !overview.host ? 'unknown' : hostSourceTone !== 'healthy' ? hostSourceTone : thresholdTone([overview.host.cpu?.totalPercent, overview.host.memory?.utilizationPercent]); + const poolSourceTone = sourceSignalTone(overview.poolSource); + const knownStorageTone = overview.pools.length ? worstSignalTone(overview.pools.map((pool) => signalToneFromState(operationalStorageState(pool.state, pool.capacitySeverity)))) : 'unknown'; + const storageTone = overview.resources.pools !== 'ready' ? 'unknown' : poolSourceTone !== 'healthy' ? poolSourceTone : overview.poolsPartial ? worstSignalTone([knownStorageTone, 'unknown']) : overview.poolTotal === 0 ? 'unknown' : knownStorageTone; + const containerSourceTone = sourceSignalTone(overview.containerSource); + const knownWorkloadTone = overview.containerTotal === 0 ? 'healthy' : worstSignalTone(overview.containers.map(containerSignalTone)); + const workloadTone = overview.resources.containers !== 'ready' ? 'unknown' : containerSourceTone !== 'healthy' ? containerSourceTone : overview.containersPartial ? worstSignalTone([knownWorkloadTone, 'unknown']) : knownWorkloadTone; + const serviceConfigured = overview.serviceCapability === 'available' && overview.serviceConfiguration === 'configured'; + const knownServiceTone = overview.services.length ? worstSignalTone(overview.services.map((service) => signalToneFromState(service.state))) : 'unknown'; + const serviceTone = overview.resources.services !== 'ready' || !serviceConfigured ? 'unknown' : overview.servicesPartial ? worstSignalTone([knownServiceTone, 'unknown']) : overview.serviceTotal === 0 ? 'unknown' : knownServiceTone; + const incidentTone = overview.resources.incidents !== 'ready' ? 'unknown' : overview.incidents.length === 0 ? 'healthy' : overview.incidents.some((incident) => signalToneFromState(incident.severity) === 'critical') ? 'critical' : 'attention'; + const orderedIncidents = [...overview.incidents].sort((left, right) => signalToneRank[signalToneFromState(left.severity)] - signalToneRank[signalToneFromState(right.severity)] || right.startedAt.localeCompare(left.startedAt) || left.id.localeCompare(right.id)); + const highestIncident = orderedIncidents[0]; + const incidentSeverity = highestIncident ? presentStatus(highestIncident.severity) : copy.overview.noOpenIncidents; + const hostUsable = overview.resources.host === 'ready' && hostSourceTone === 'healthy'; + const poolsUsable = overview.resources.pools === 'ready' && poolSourceTone === 'healthy'; + const containersUsable = overview.resources.containers === 'ready' && containerSourceTone === 'healthy'; + const servicesUsable = overview.resources.services === 'ready' && serviceConfigured; + const signalStages: OperationalSignalStage[] = [ + { id: 'sources', label: copy.overview.sources, icon: '◉', tone: sourceTone, statusLabel: signalResourceLabel(systemResourceState, sourceTone), primaryLabel: copy.overview.connectedSources, primaryValue: snapshot.state === 'ready' ? `${healthySources}/${sourceTones.length || '—'}` : '—', secondaryLabel: copy.overview.freshness, secondaryValue: signalResourceLabel(systemResourceState, sourceTone), detail: copy.overview.signalPathSourcesDetail, route: '/status' }, + { id: 'host', label: copy.navigation.host, icon: '▣', tone: hostTone, statusLabel: signalResourceLabel(overview.resources.host, hostTone), primaryLabel: copy.overview.cpu, primaryValue: hostUsable ? metric(overview.host?.cpu?.totalPercent) : '—', secondaryLabel: copy.overview.memoryShort, secondaryValue: hostUsable ? metric(overview.host?.memory?.utilizationPercent) : '—', detail: copy.overview.signalPathHostDetail, route: '/host' }, + { id: 'storage', label: copy.overview.signalStorage, icon: '▤', tone: storageTone, statusLabel: signalCollectionLabel(overview.resources.pools, storageTone, { partial: overview.poolsPartial }), primaryLabel: copy.overview.storage, primaryValue: poolsUsable ? (overview.poolsPartial && poolUsage != null ? `≥${metric(poolUsage)}` : metric(poolUsage)) : '—', secondaryLabel: copy.navigation.pools, secondaryValue: poolsUsable ? String(overview.poolTotal) : '—', detail: copy.overview.signalPathStorageDetail, route: '/storage' }, + { id: 'workloads', label: copy.overview.signalWorkloads, icon: '⬡', tone: workloadTone, statusLabel: signalCollectionLabel(overview.resources.containers, workloadTone, { partial: overview.containersPartial, emptyLabel: overview.containerTotal === 0 ? copy.overview.signalPathNoWorkloads : undefined }), primaryLabel: copy.overview.activeContainers, primaryValue: containersUsable ? boundedRatio(runningContainers, overview.containerTotal, overview.containersPartial) : '—', secondaryLabel: copy.overview.total, secondaryValue: containersUsable ? String(overview.containerTotal) : '—', detail: copy.overview.signalPathWorkloadsDetail, route: '/containers' }, + { id: 'services', label: copy.navigation.services, icon: '◇', tone: serviceTone, statusLabel: signalCollectionLabel(overview.resources.services, serviceTone, { partial: overview.servicesPartial, notConfigured: overview.serviceConfiguration === 'not_configured' }), primaryLabel: copy.overview.available, primaryValue: servicesUsable ? boundedRatio(availableServices, overview.serviceTotal, overview.servicesPartial) : '—', secondaryLabel: copy.overview.total, secondaryValue: servicesUsable ? String(overview.serviceTotal) : '—', detail: copy.overview.signalPathServicesDetail, route: '/services' }, + { id: 'incidents', label: copy.overview.signalIncidents, icon: '△', tone: incidentTone, statusLabel: signalCollectionLabel(overview.resources.incidents, incidentTone, { partial: overview.incidentsPartial }), primaryLabel: copy.overview.openIncidents, primaryValue: overview.resources.incidents === 'ready' ? `${overview.incidents.length}${overview.incidentsPartial ? '+' : ''}` : '—', secondaryLabel: copy.overview.highestSeverity, secondaryValue: overview.resources.incidents === 'ready' ? incidentSeverity : '—', detail: copy.overview.signalPathIncidentsDetail, route: '/incidents' }, + ]; + const hasSignalAttention = signalStages.some((stage) => stage.tone === 'critical' || stage.tone === 'attention'); + const hasSignalUncertainty = signalStages.some((stage) => stage.tone === 'stale' || stage.tone === 'unknown'); + const heading = hasSignalAttention || problems.length > 0 || (poolUsage != null && poolUsage >= 90) ? copy.overview.attentionTitle : hasSignalUncertainty ? copy.overview.unknownTitle : copy.overview.title; + return
    +

    {copy.overview.eyebrow}

    {heading}

    {copy.overview.intro}

    {snapshot.status ? formatDateTime(snapshot.status.generatedAt) : copy.overview.statusLoading}
    +
    + {sourceLags.slice(0, 6).map((source) => {presentComponent(source.sourceId)}{presentStatus(source.state)})} + {sourceLags.length === 0 && {copy.overview.sourceLag}{copy.overview.unknown}} +
    +
    +

    {copy.overview.cpu}

    {hostUsable ? metric(overview.host?.cpu?.totalPercent) : '—'}{hostUsable ? presentStatus(overview.host?.source?.freshness ?? 'unknown') : signalResourceLabel(overview.resources.host, hostTone)}
    +

    {copy.overview.memory}

    {hostUsable ? metric(overview.host?.memory?.utilizationPercent) : '—'}{hostUsable ? overview.host?.identity?.name ?? copy.overview.unknown : signalResourceLabel(overview.resources.host, hostTone)}
    +

    {copy.overview.storage}

    {poolsUsable ? (overview.poolsPartial && poolUsage != null ? `≥${metric(poolUsage)}` : metric(poolUsage)) : '—'}{poolsUsable ? `${overview.poolTotal} ${copy.navigation.pools.toLowerCase()}` : signalResourceLabel(overview.resources.pools, storageTone)}
    +

    {copy.overview.services}

    {servicesUsable ? boundedRatio(availableServices, overview.serviceTotal, overview.servicesPartial) : '—'}{overview.resources.services !== 'ready' ? signalResourceLabel(overview.resources.services, serviceTone) : !serviceConfigured ? copy.overview.signalPathNotConfigured : overview.servicesPartial ? copy.overview.signalPathPartial : copy.overview.available}
    +
    +
    +

    {copy.overview.actionQueue}

    {copy.overview.problems}

    {problems.length}
    {problems.length ?
      {problems.map((problem, index) =>
    1. {index === 0 ? '!' : '?'}{problem.label}{problem.reason}
    2. )}
    :

    {resourcesLoading ? copy.overview.loadingResources : copy.overview.noProblems}

    }
    {overviewNeedsAuthentication && }
    + +

    {copy.overview.storagePools}

    {copy.overview.capacity}

    {overview.resources.pools !== 'ready' ?

    {resourceStateDetail(overview.resources.pools)}

    : poolSourceTone !== 'healthy' ?

    {copy.overview.resourceStaleDetail}

    : overview.pools.length ?
      {overview.pools.slice(0, 5).map((pool) => { const state = operationalStorageState(pool.state, pool.capacitySeverity); return
    • {pool.name}{presentStatus(state)} · device-health {presentStatus(pool.state).toLowerCase()}{metric(pool.utilizationPercent)}
    • ; })}
    :

    {copy.overview.noPools}

    }
    +

    Nu

    {copy.navigation.containers}

    {containersUsable ? `${overview.containersPartial ? '≥' : ''}${runningContainers}` : '—'}{copy.overview.running}{containersUsable && !overview.containersPartial ? Math.max(0, overview.containerTotal - runningContainers) : '—'}{copy.overview.other}

    {overview.resources.containers !== 'ready' ? resourceStateDetail(overview.resources.containers) : containerSourceTone !== 'healthy' ? copy.overview.resourceStaleDetail : overview.containersPartial ? copy.overview.resourcePartialDetail : overview.containerTotal > 0 ? `${runningContainers} van ${overview.containerTotal} ${copy.overview.containersRunning}.` : copy.overview.signalPathNoWorkloads}

    {copy.overview.cpu}
    {hostUsable ? metric(overview.host?.cpu?.totalPercent) : '—'}
    {copy.overview.memory}
    {hostUsable ? metric(overview.host?.memory?.utilizationPercent) : '—'}
    Bron
    {hostUsable ? presentStatus(overview.host?.source?.freshness ?? 'unknown') : signalResourceLabel(overview.resources.host, hostTone)}
    +

    {copy.overview.recentIncidents}

    {copy.navigation.incidents}

    {overview.resources.incidents !== 'ready' ?

    {resourceStateDetail(overview.resources.incidents)}

    : orderedIncidents.length ?
      {orderedIncidents.slice(0, 5).map((incident) =>
    • )}
    :

    {copy.overview.noIncidents}

    }
    +
    +
    ; +} + +type ApiRecord = Record; +type DashboardSummary = { id: string; slug: string; name: string; description: string; scope: string; revision: number; currentVersion: number }; +type DashboardWidget = { id: string; type: string; title: string; description?: string; data?: ApiRecord; visualization?: ApiRecord; behavior?: ApiRecord; layouts?: ApiRecord }; +type DashboardViewport = 'desktop' | 'tablet' | 'mobile' | 'wallboard'; +type CrossFilter = { key: string; value: string; label: string; sourceWidgetId: string }; +class ApiError extends Error { constructor(readonly status: number) { super('api request failed'); } } +function field(record: ApiRecord | undefined, name: string): T | undefined { + if (!record) return undefined; + const upper = name.charAt(0).toUpperCase() + name.slice(1); + return (record[name] ?? record[upper] ?? record[name.toUpperCase()]) as T | undefined; +} +function summaryFromApi(record: ApiRecord): DashboardSummary { + return { id: String(field(record, 'id') ?? ''), slug: String(field(record, 'slug') ?? ''), name: String(field(record, 'name') ?? copy.dashboards.unnamed), description: String(field(record, 'description') ?? ''), scope: String(field(record, 'scope') ?? 'unknown'), revision: Number(field(record, 'revision') ?? 0), currentVersion: Number(field(record, 'currentVersion') ?? 0) }; +} +async function getJSON(url: string, signal: AbortSignal): Promise { + const response = await fetch(url, { signal, cache: 'no-store' }); + if (!response.ok) throw new ApiError(response.status); + return response.json() as Promise; +} + +function DashboardsPage() { + const [state, setState] = useState<'loading' | 'error' | 'unauthorized' | 'empty' | 'ready'>('loading'); + const [items, setItems] = useState([]); + const [reload, setReload] = useState(0); + useEffect(() => { + const controller = new AbortController(); + // Rotation is a background replacement once a dashboard is visible. Keep + // the current view (and any identical shared live subscription) mounted + // until the next document arrives instead of bouncing through `loading`. + setState((current) => current === 'ready' ? current : 'loading'); + getJSON<{ items?: ApiRecord[] }>('/api/v1/dashboards?limit=100', controller.signal).then((data) => { + const next = (data.items ?? []).map(summaryFromApi).filter((item) => item.id !== ''); + setItems(next); setState(next.length === 0 ? 'empty' : 'ready'); + }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState(error instanceof ApiError && error.status === 401 ? 'unauthorized' : 'error'); + }); + return () => controller.abort(); + }, [reload]); + const stateContent = state === 'loading' ?

    {copy.dashboards.loading}

    : + state === 'unauthorized' ?

    {copy.dashboards.unauthorizedTitle}

    {copy.dashboards.unauthorizedDetail}

    : + state === 'error' ?

    {copy.dashboards.errorTitle}

    {copy.dashboards.errorDetail}

    : + state === 'empty' ?

    {copy.dashboards.empty}

    {copy.dashboards.emptyDetail}

    : +
      {items.map((item) =>
    • )}
    ; + return <>

    {copy.dashboards.catalog}

    {copy.dashboards.listTitle}

    {stateContent}
    {state === 'ready' &&

    {items.length} {copy.dashboards.available}

    }; +} + +class WidgetBoundary extends Component<{ title: string; children: ReactNode }, { failed: boolean }> { + state = { failed: false }; + static getDerivedStateFromError(): { failed: boolean } { return { failed: true }; } + componentDidCatch(_error: Error, _info: ErrorInfo): void {} + render() { return this.state.failed ?

    {copy.dashboards.widgetError}

    {this.props.title}

    {copy.dashboards.widgetErrorDetail}

    : this.props.children; } +} +const widgetLabels: Record = { stat: copy.widgets.stat, timeseries: copy.widgets.timeseries, gauge: copy.widgets.gauge, 'ranked-list': copy.widgets.rankedList, 'status-grid': copy.widgets.statusGrid, table: copy.widgets.table, heatmap: copy.widgets.heatmap, 'event-timeline': copy.widgets.eventTimeline, 'storage-map': copy.widgets.storageMap, topology: copy.widgets.topology, 'service-matrix': copy.widgets.serviceMatrix, 'alert-summary': copy.widgets.alertSummary, text: copy.widgets.text, 'query-inspector': copy.widgets.queryInspector }; + +// Installed before any client captures the global `fetch`, so every API call in +// the app funnels its 401s through one place. +installSessionWatcher(); +function responsiveViewport(): 'desktop' | 'tablet' | 'mobile' { return window.innerWidth <= 700 ? 'mobile' : window.innerWidth <= 900 ? 'tablet' : 'desktop'; } +function widgetFilter(widget: DashboardWidget): { key: string; value: string; label: string } { + const data = widget.data ?? {}; + const scope = field(data, 'scope') ?? {}; + const entityType = field(scope, 'entityType'); + const sourceType = String(field(data, 'sourceType') ?? 'unknown'); + return entityType ? { key: 'entityType', value: entityType, label: entityType } : { key: 'sourceType', value: sourceType, label: sourceType }; +} +function filterAllowed(document: ApiRecord, key: string, value: string): boolean { + const safeSources = ['semantic-metric', 'inventory', 'events', 'alerts', 'incidents', 'text']; + if (key === 'sourceType') return safeSources.includes(value); + const variables = (field(document, 'variables') ?? []) as ApiRecord[]; + return variables.some((variable) => { const options = field(variable, 'options') ?? []; return options.includes(value); }); +} +function filterFromURL(document: ApiRecord): CrossFilter | null { + const params = new URLSearchParams(window.location.search); + const key = params.get('filterKey'); + const value = params.get('filterValue'); + if (!key || !value || !filterAllowed(document, key, value)) return null; + return { key, value, label: value, sourceWidgetId: '' }; +} +function compatibleWithFilter(widget: DashboardWidget, filter: CrossFilter | null): boolean { + if (!filter || widget.id === filter.sourceWidgetId) return true; + const next = widgetFilter(widget); + return next.key === filter.key && next.value === filter.value; +} +function wallboardSlideFor(widget: DashboardWidget): number { + const layout = field(widget.layouts ?? {}, 'wallboard') ?? field(widget.layouts ?? {}, 'desktop') ?? {}; + return wallboardSlideIndex(field(layout, 'y')); +} +function widgetLayoutStyle(layout: ApiRecord, viewport: DashboardViewport): CSSProperties { + const columns = viewport === 'wallboard' ? wallboardColumns : viewport === 'tablet' ? 8 : viewport === 'mobile' ? 1 : 18; + const width = viewport === 'mobile' ? 1 : Math.min(columns, Math.max(1, Number(field(layout, 'w') ?? 6))); + if (viewport !== 'wallboard') return { '--widget-span': String(width) } as CSSProperties; + const placement = wallboardPlacement(layout); + return { '--widget-span': String(placement.columnSpan), gridColumn: `${placement.columnStart} / span ${placement.columnSpan}`, gridRow: `${placement.rowStart} / span ${placement.rowSpan}` } as CSSProperties; +} +function DashboardWidgetView({ widget, viewport, onFilter, metric }: { widget: DashboardWidget; viewport: DashboardViewport; onFilter: (widget: DashboardWidget) => void; metric?: MetricWidgetProps }) { + if (!widget.id || !widget.title) return

    {copy.dashboards.widgetError}

    {copy.widgets.unknown}

    {copy.dashboards.widgetErrorDetail}

    ; + const behavior = widget.behavior ?? {}; + if (field(behavior, 'hidden')) return null; + const activeLayout = field(widget.layouts ?? {}, viewport) ?? field(widget.layouts ?? {}, 'desktop') ?? {}; + if (field(activeLayout, 'visible') === false) return null; + const typeLabel = widgetLabels[widget.type] ?? copy.widgets.unknown; + const source = String(field(widget.data ?? {}, 'sourceType') ?? copy.dashboards.unknown); + const status = metric ? metricStatus(metric) : { label: copy.dashboards.unknown, tone: 'unknown' as const }; + const metricKind = metric && (widget.type === 'stat' || widget.type === 'timeseries' || widget.type === 'gauge' || widget.type === 'query-inspector'); + const widgetItems = (field(widget.data ?? {}, 'items') ?? []) as ApiRecord[]; + const rankedItems: RankedListItem[] = widgetItems.map((item) => ({ id: String(field(item, 'id') ?? ''), label: String(field(item, 'label') ?? field(item, 'name') ?? ''), value: String(field(item, 'value') ?? ''), detail: field(item, 'detail') } )).filter((item) => item.id !== '' && item.label !== ''); + const statusItems: StatusGridItem[] = widgetItems.map((item) => ({ id: String(field(item, 'id') ?? ''), label: String(field(item, 'label') ?? field(item, 'name') ?? ''), status: String(field(item, 'status') ?? 'unknown'), reason: field(item, 'reason') } )).filter((item) => item.id !== '' && item.label !== ''); + const storageNodes: StorageMapNode[] = widgetItems.map((item) => ({ id: String(field(item, 'id') ?? ''), label: String(field(item, 'label') ?? field(item, 'name') ?? ''), kind: String(field(item, 'kind') ?? 'storage'), state: String(field(item, 'status') ?? 'unknown'), detail: field(item, 'detail'), href: field(item, 'href') })).filter((item) => item.id !== '' && item.label !== ''); + const topologyData = field(widget.data ?? {}, 'topology'); + const networkData = field(widget.data ?? {}, 'network'); + const heatmapPoints: HeatmapPoint[] = widgetItems.map((item) => { const value = Number(field(item, 'value')); return { id: String(field(item, 'id') ?? ''), label: String(field(item, 'label') ?? field(item, 'name') ?? ''), observedAt: String(field(item, 'observedAt') ?? new Date(0).toISOString()), value: Number.isFinite(value) ? value : null, status: String(field(item, 'status') ?? 'unknown'), href: field(item, 'href') }; }).filter((item) => item.id !== '' && item.label !== ''); + return

    {typeLabel}

    {widget.title}

    {widget.description &&

    {widget.description}

    }{metricKind ? : widget.type === 'ranked-list' && rankedItems.length > 0 ? onFilter(widget)} /> : widget.type === 'status-grid' && statusItems.length > 0 ? onFilter(widget)} /> : widget.type === 'storage-map' && storageNodes.length > 0 ? : widget.type === 'topology' && topologyData ? {copy.topology.loading}

    }>
    : widget.type === 'network' && networkData ? : widget.type === 'heatmap' && heatmapPoints.length > 0 ? : }
    ; +} +function DashboardViewPage({ dashboardId, wallboard = false, wallboardSlide = 0, onWallboardSlideCount, onRuntimeState }: { dashboardId: string; wallboard?: boolean; wallboardSlide?: number; onWallboardSlideCount?: (count: number) => void; onRuntimeState?: (state: RuntimeState) => void }) { + const [state, setState] = useState<'loading' | 'error' | 'unauthorized' | 'ready'>('loading'); + const [summary, setSummary] = useState(null); + const [document, setDocument] = useState({}); + const [widgets, setWidgets] = useState([]); + const [editing, setEditing] = useState(false); + const [crossFilter, setCrossFilter] = useState(null); + const [runtimeStates, setRuntimeStates] = useState>({}); + const hasWallboardContent = useRef(false); + const systemSnapshot = useSystemStatus(); + const storageKey = 'pulse.dashboard.view.' + dashboardId; + const [timeRange, setTimeRange] = useState(() => wallboard ? 'live' : window.localStorage.getItem(storageKey + '.range') ?? '1h'); + const [filter, setFilter] = useState(() => window.localStorage.getItem(storageKey + '.filter') ?? ''); + const updateRuntimeState = useCallback((id: string, next: RuntimeState) => setRuntimeStates((current) => current[id] === next ? current : { ...current, [id]: next }), []); + useEffect(() => { + const controller = new AbortController(); + const replacingVisibleWallboard = wallboard && hasWallboardContent.current; + if (!replacingVisibleWallboard) setState('loading'); + getJSON<{ dashboard: ApiRecord; version: ApiRecord }>('/api/v1/dashboards/' + encodeURIComponent(dashboardId), controller.signal).then((data) => { + const rawDocument = field(data.version, 'document') ?? {}; + setDocument(rawDocument); + setCrossFilter(filterFromURL(rawDocument)); + setSummary(summaryFromApi(data.dashboard)); + setWidgets((field(rawDocument, 'widgets') ?? []) as DashboardWidget[]); + setRuntimeStates({}); + if (wallboard) hasWallboardContent.current = true; + setState('ready'); + }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + if (error instanceof ApiError && error.status === 401) { + setState('unauthorized'); + return; + } + // A wallboard is a continuous operational display. During a transient + // failed rotation, keep the last verified document visible and let the + // next bounded rotation/refresh retry. Never apply this to first load or + // authentication failure. + if (!replacingVisibleWallboard) setState('error'); + }); + return () => controller.abort(); + }, [dashboardId, wallboard]); + useEffect(() => { window.localStorage.setItem(storageKey + '.range', timeRange); }, [storageKey, timeRange]); + useEffect(() => { window.localStorage.setItem(storageKey + '.filter', filter); }, [storageKey, filter]); + useEffect(() => { + const values = Object.values(runtimeStates); + const aggregate: RuntimeState = values.includes('usable') ? 'usable' : values.includes('error') ? 'error' : values.length > 0 && values.every((value) => value === 'empty') ? 'empty' : 'loading'; + onRuntimeState?.(aggregate); + }, [onRuntimeState, runtimeStates]); + useEffect(() => { if (wallboard) setRuntimeStates({}); }, [wallboard, wallboardSlide]); + const wallboardWidgets = widgets.filter((widget) => { + const layout = field(widget.layouts ?? {}, 'wallboard') ?? field(widget.layouts ?? {}, 'desktop') ?? {}; + return field(widget.behavior ?? {}, 'hidden') !== true && field(layout, 'visible') !== false; + }); + const wallboardSlideCount = Math.max(1, ...wallboardWidgets.map((widget) => wallboardSlideFor(widget) + 1)); + useEffect(() => { if (wallboard) onWallboardSlideCount?.(wallboardSlideCount); }, [onWallboardSlideCount, wallboard, wallboardSlideCount]); + if (state === 'loading') return
    ; + if (state === 'unauthorized') return ; + if (state === 'error' || !summary) return ; + if (editing) return }> setEditing(false)} onSaved={(revision, nextDocument) => { setDocument(nextDocument); setWidgets((field(nextDocument, 'widgets') ?? []) as DashboardWidget[]); setSummary({ ...summary, revision, currentVersion: summary.currentVersion + 1 }); setEditing(false); }} />; + const viewport: DashboardViewport = wallboard ? 'wallboard' : responsiveViewport(); + const normalized = filter.trim().toLowerCase(); + const shown = widgets.filter((widget) => { const activeLayout = field(widget.layouts ?? {}, viewport) ?? field(widget.layouts ?? {}, 'desktop') ?? {}; return field(widget.behavior ?? {}, 'hidden') !== true && field(activeLayout, 'visible') !== false && (!wallboard || wallboardSlideFor(widget) === Math.min(wallboardSlide, wallboardSlideCount - 1)) && (!normalized || widget.title.toLowerCase().includes(normalized)) && compatibleWithFilter(widget, crossFilter); }); + const systemStatus = aggregateStatus(systemSnapshot); + const applyCrossFilter = (widget: DashboardWidget) => { const next = widgetFilter(widget); const filter = { ...next, sourceWidgetId: widget.id }; setCrossFilter(filter); const params = new URLSearchParams(window.location.search); params.set('filterKey', filter.key); params.set('filterValue', filter.value); window.history.replaceState({}, '', window.location.pathname + '?' + params.toString()); }; + const clearCrossFilter = () => { setCrossFilter(null); const params = new URLSearchParams(window.location.search); params.delete('filterKey'); params.delete('filterValue'); const query = params.toString(); window.history.replaceState({}, '', window.location.pathname + (query ? '?' + query : '')); }; + + const usableCount = Object.values(runtimeStates).filter((value) => value === 'usable').length; + return
    {!wallboard && }

    {copy.dashboards.viewMode}

    {wallboard ?

    {summary.name}

    :

    {summary.name}

    }

    {summary.description || copy.dashboards.noDescription}

    {wallboard && {copy.wallboard.readOnly}}{copy.dashboards.version} {summary.currentVersion}{!wallboard && }
    {!wallboard &&
    {crossFilter ? copy.dashboards.filterActive + ': ' + crossFilter.label : copy.dashboards.fixedView}{usableCount} van {shown.length} {copy.dashboards.widgetsWithData}{crossFilter && }
    }{shown.length === 0 ?

    {copy.dashboards.noMatchingWidgets}

    {copy.dashboards.clearFilterHint}

    : <>

    {copy.dashboards.widgetCollection}

    {shown.map((widget) => {['semantic-metric', 'inventory', 'events'].includes(String(field(widget.data, 'sourceType') ?? '')) ? applyCrossFilter(widget)} /> : })}
    }
    ; +} + +type WallboardPriorityData = { serviceProblems: number; openIncidents: number; loading: boolean; unavailable: boolean }; +function useWallboardPriorityData(): WallboardPriorityData { + const [value, setValue] = useState({ serviceProblems: 0, openIncidents: 0, loading: true, unavailable: false }); + useEffect(() => { + let active = true; + let controller: AbortController | null = null; + const load = async () => { + controller?.abort(); + const current = new AbortController(); + controller = current; + try { + const [servicesResponse, incidentsResponse] = await Promise.all([ + fetch('/api/v1/services?limit=100', { signal: current.signal, cache: 'no-store' }), + fetch('/api/v1/incidents?limit=100&status=open', { signal: current.signal, cache: 'no-store' }), + ]); + if (!servicesResponse.ok || !incidentsResponse.ok) throw new Error('priority'); + const services = await servicesResponse.json() as { services?: Array<{ state?: string }> }; + const incidents = await incidentsResponse.json() as { items?: unknown[] }; + if (active) setValue({ serviceProblems: (services.services ?? []).filter((item) => item.state !== 'up').length, openIncidents: (incidents.items ?? []).length, loading: false, unavailable: false }); + } catch (error: unknown) { + if (error instanceof DOMException && error.name === 'AbortError') return; + if (active) setValue((currentValue) => ({ ...currentValue, loading: false, unavailable: true })); + } + }; + void load(); + const timer = window.setInterval(load, 30000); + return () => { active = false; controller?.abort(); window.clearInterval(timer); }; + }, []); + return value; +} + +function WallboardPage() { + const [state, setState] = useState<'loading' | 'ready' | 'error' | 'unauthorized' | 'empty'>('loading'); + const [items, setItems] = useState([]); + const [activeIndex, setActiveIndex] = useState(0); + const [activeSlide, setActiveSlide] = useState(0); + const [slideCount, setSlideCount] = useState(1); + const [lastUpdated, setLastUpdated] = useState(); + const [transport, setTransport] = useState<'connected' | 'reconnecting' | 'unavailable'>('reconnecting'); + const [dataState, setDataState] = useState('loading'); + const [fullscreen, setFullscreen] = useState(false); + const [shift, setShift] = useState(0); + const systemSnapshot = useSystemStatus(); + const system = aggregateStatus(systemSnapshot); + const storage = systemSnapshot.status?.components.find((component) => component.id === 'storage'); + const priority = useWallboardPriorityData(); + const params = new URLSearchParams(window.location.search); + const intervalSeconds = Math.min(300, Math.max(10, Number(params.get('interval') ?? 30) || 30)); + const refreshSeconds = Math.min(300, Math.max(10, Number(params.get('refresh') ?? 30) || 30)); + + useEffect(() => onUnauthenticated(() => { setTransport('unavailable'); setState('unauthorized'); }), []); + + useEffect(() => { + let active = true; + let inFlight: AbortController | null = null; + const load = async () => { + inFlight?.abort(); + const controller = new AbortController(); + inFlight = controller; + try { + const response = await fetch('/api/v1/dashboards?limit=100', { signal: controller.signal, cache: 'no-store' }); + if (!response.ok) throw new Error('wallboard'); + const data = await response.json() as { items?: ApiRecord[] }; + const next = (data.items ?? []).map(summaryFromApi).filter((item) => item.id !== '').sort((a, b) => a.id.localeCompare(b.id)); + if (!active) return; + setItems(next); + setActiveIndex((value) => next.length === 0 ? 0 : Math.min(value, next.length - 1)); + setLastUpdated(new Date().toISOString()); + setTransport('connected'); + setState(next.length === 0 ? 'empty' : 'ready'); + } catch (error: unknown) { + if (error instanceof DOMException && error.name === 'AbortError') return; + if (!active) return; + setTransport('unavailable'); + setState((value) => value === 'ready' || value === 'unauthorized' ? value : 'error'); + } finally { + if (inFlight === controller) inFlight = null; + } + }; + void load(); + const refresh = window.setInterval(() => { setTransport('reconnecting'); void load(); }, refreshSeconds * 1000); + return () => { active = false; inFlight?.abort(); window.clearInterval(refresh); }; + }, []); + + useEffect(() => { + if (items.length === 0) return undefined; + const rotation = window.setInterval(() => setActiveSlide((value) => { + if (value + 1 < slideCount) return value + 1; + if (items.length > 1) setActiveIndex((dashboard) => (dashboard + 1) % items.length); + return 0; + }), intervalSeconds * 1000); + return () => window.clearInterval(rotation); + }, [items.length, intervalSeconds, slideCount]); + + useEffect(() => { + const timer = window.setInterval(() => setShift((value) => (value + 1) % 2), 60000); + return () => window.clearInterval(timer); + }, []); + + useEffect(() => { + const update = () => setFullscreen(Boolean(document.fullscreenElement)); + document.addEventListener('fullscreenchange', update); + update(); + return () => document.removeEventListener('fullscreenchange', update); + }, []); + + const toggleFullscreen = async () => { + try { + if (document.fullscreenElement) await document.exitFullscreen(); + else if (document.documentElement.requestFullscreen) await document.documentElement.requestFullscreen(); + } catch { /* Fullscreen is optional; transport and data state remain truthful. */ } + }; + const handleRuntimeState = useCallback((runtime: RuntimeState) => setDataState(runtime), []); + const handleSlideCount = useCallback((count: number) => { setSlideCount(Math.max(1, count)); setActiveSlide((value) => Math.min(value, Math.max(1, count) - 1)); }, []); + + if (state === 'loading') return

    {copy.wallboard.eyebrow}

    {copy.wallboard.loading}

    ; + if (state === 'unauthorized') return

    {copy.wallboard.eyebrow}

    {copy.states.unauthorizedTitle}

    {copy.states.unauthorizedDetail}

    ; + if (state === 'error') return

    {copy.wallboard.eyebrow}

    {copy.wallboard.errorTitle}

    {copy.wallboard.errorDetail}

    ; + if (state === 'empty') return

    {copy.wallboard.eyebrow}

    {copy.wallboard.noDashboards}

    ; + + const current = items[activeIndex]; + return
    +

    {copy.wallboard.eyebrow}

    {copy.wallboard.title}

    {copy.wallboard.intro}

    {copy.wallboard.transport}: {transport === 'connected' ? copy.wallboard.connected : transport === 'reconnecting' ? copy.wallboard.reconnecting : copy.wallboard.unavailable}{copy.wallboard.data}: {dataState === 'usable' ? copy.wallboard.dataUsable : dataState === 'loading' ? copy.wallboard.dataLoading : dataState === 'empty' ? copy.wallboard.dataEmpty : copy.wallboard.unavailable}
    +
    {copy.wallboard.overall}{system.label}{copy.wallboard.storage}{storage ? presentStatus(storage.state) : copy.wallboard.unknown}{copy.wallboard.services}{priority.loading ? copy.wallboard.dataLoading : priority.unavailable ? copy.wallboard.unknown : `${priority.serviceProblems} ${copy.wallboard.problems}`}{copy.wallboard.incidents}{priority.loading ? copy.wallboard.dataLoading : priority.unavailable ? copy.wallboard.unknown : `${priority.openIncidents} ${copy.wallboard.open}`}
    +
    {copy.wallboard.lastUpdated}: {lastUpdated ? formatDateTime(lastUpdated) : copy.wallboard.reconnecting}{copy.wallboard.rotate} {copy.wallboard.every} {intervalSeconds} {copy.wallboard.seconds}{copy.wallboard.slide} {activeSlide + 1} / {slideCount}{copy.wallboard.dashboard} {activeIndex + 1} / {items.length}
    +
    +
    ; +} +const AlertsPage = AlertRulesPage; +function SettingsPage() { + const snapshot = useSystemStatus(); + const status = aggregateStatus(snapshot); + const connected = snapshot.status?.sourceLag.filter((source) => source.state === 'healthy').length ?? 0; + const total = snapshot.status?.sourceLag.length ?? 0; + const sourceDetail = snapshot.state === 'ready' && total > 0 ? `${connected} van ${total} ${copy.settings.sourcesCurrent}` : status.detail; + const groups = [ + { title: copy.settings.healthTitle, detail: copy.settings.healthDetail, links: [ + { href: '/status', title: copy.settings.systemStatus, detail: copy.settings.systemStatusDetail, access: copy.settings.adminActions }, + { href: '/onboarding', title: copy.settings.onboarding, detail: copy.settings.onboardingDetail, access: copy.settings.adminChanges }, + ] }, + { title: copy.settings.alertingTitle, detail: copy.settings.alertingDetail, links: [ + { href: '/alerts?section=rules', title: copy.settings.alertRules, detail: copy.settings.alertRulesDetail, access: copy.settings.editorChanges }, + { href: '/alerts?section=controls', title: copy.settings.alertControls, detail: copy.settings.alertControlsDetail, access: copy.settings.operatorChanges }, + ] }, + { title: copy.settings.presentationTitle, detail: copy.settings.presentationDetail, links: [ + { href: '/dashboards', title: copy.settings.dashboards, detail: copy.settings.dashboardsDetail, access: copy.settings.editorChanges }, + { href: '/inventory', title: copy.settings.inventory, detail: copy.settings.inventoryDetail, access: copy.settings.viewAccess }, + ] }, + ]; + return <> +

    {copy.settings.current}

    {copy.settings.environment}

    {copy.settings.source}{sourceDetail}{connected}/{total || '—'}
    {copy.settings.language}{copy.settings.languageDetail}{copy.settings.languageValue}
    +

    {copy.settings.management}

    {groups.map((group) => )}
    + ; +} +function StatePage({ kind }: { kind: 'loading' | 'error' | 'unauthorized' }) { + if (kind === 'loading') return
    ; + if (kind === 'unauthorized') { + // The API answered 401, so the visitor is not signed in: offer the real + // sign-in entry point and come back to the page they asked for. + return

    {copy.states.unauthorizedTitle}

    {copy.states.unauthorizedDetail}

    {copy.auth.signInHint}

    ; + } + return

    {copy.states.errorTitle}

    {copy.states.errorDetail}

    ; +} + +/** Wraps lazily loaded routes in the same loading state the rest of the app uses. */ +function RouteSuspense({ children }: { children: ReactNode }) { + return }>{children}; +} + +function Page({ route }: { route: RoutePath }) { + if (route.startsWith('/inventory/')) return ; + if (route.startsWith('/dashboards/')) return ; + if (route.startsWith('/services/')) return ; + if (route.startsWith('/incidents/')) return ; + if (route.startsWith('/containers/')) return ; + if (route.startsWith('/disks/')) return ; + if (route.startsWith('/pools/')) return ; + if (route.startsWith('/shares/')) return ; + if (route.startsWith('/applications/')) return ; + switch (route) { + case '/': return ; + case '/processes': return ; + case '/containers': return ; + case '/services': return ; + case '/topology': return ; + case '/network': return ; + case '/applications': return ; + case '/host': return ; + case '/array': return ; + case '/disks': return ; + case '/pools': return ; + case '/shares': return ; + case '/storage': return ; + case '/capacity': return ; + case '/inventory': return ; + case '/dashboards': return ; + case '/wallboard': return ; + case '/alerts': return ; + case '/events': return ; + case '/incidents': return ; + case '/settings': return ; + case '/status': return ; + case '/onboarding': return ; + case '/loading': return ; + case '/error': return ; + case '/unauthorized': return ; + case '/404': return ; + default: return ; + } +} + +function App() { + const [route, setRoute] = useState(() => routeFromLocation(window.location.pathname)); + const shellStatus = aggregateStatus(useSystemStatus()); + useEffect(() => { const handleNavigation = () => setRoute(routeFromLocation(window.location.pathname)); window.addEventListener('popstate', handleNavigation); return () => window.removeEventListener('popstate', handleNavigation); }, []); + useEffect(() => { + const mobileMenu = document.querySelector('.mobile-more'); + if (mobileMenu?.open) mobileMenu.open = false; + }, [route]); + const currentNavigation = navigation.find((item) => item.path === route) + ?? navigation.find((item) => item.path !== '/' && route.startsWith(item.path + '/')) + ?? navigation[0]; + if (route === '/wallboard') return ; + return
    {copy.accessibility.skipToContent}
    ServerTower
    Live verbondenAlle bronnen · alleen-lezen
    ; +} +export default App; diff --git a/apps/web/src/ApplicationPage.tsx b/apps/web/src/ApplicationPage.tsx new file mode 100644 index 0000000..336adf2 --- /dev/null +++ b/apps/web/src/ApplicationPage.tsx @@ -0,0 +1,47 @@ +import { useEffect, useState } from 'react'; +import { copy } from './copy'; +import { presentReason } from './presentation'; +import { SourceStatusDetails } from './SourceStatusDetails'; + +type ComponentItem = { id: string; name: string; kind: string; critical: boolean; containerState: string; serviceState: string; status: string; reason?: string }; +type ApplicationItem = { id: string; name: string; status: string; overridden: boolean; components: ComponentItem[]; reasons?: Array<{ code: string; message: string; componentId?: string; critical: boolean }> }; +type ApplicationSnapshot = { source: { id: string; state: string; freshness: string; observedAt?: string; reason?: string }; applications: ApplicationItem[]; total: number }; +type ApplicationDetail = { source: ApplicationSnapshot['source']; application: ApplicationItem }; + +function Badge({ state }: { state: string }) { + const normalized = state.toLowerCase(); + const tone = normalized === 'healthy' ? 'ready' : normalized === 'degraded' || normalized === 'down' ? 'attention' : 'unknown'; + return {normalized === 'healthy' ? copy.applications.healthy : normalized === 'degraded' || normalized === 'down' ? copy.applications.degraded : copy.applications.unknown}; +} +function Source({ source }: { source: ApplicationSnapshot['source'] }) { + return ; +} +function Components({ items }: { items: ComponentItem[] }) { + return
    {copy.applications.components} ({items.length})
    {items.map((item) =>
    {item.name}{item.kind} · {item.critical ? copy.applications.critical : copy.applications.optional}
    {item.reason || item.id}
    )}
    ; +} + +export function ApplicationPage({ id }: { id?: string }) { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [data, setData] = useState(null); + useEffect(() => { + const controller = new AbortController(); + const url = id ? '/api/v1/applications/' + encodeURIComponent(id) : '/api/v1/applications'; + fetch(url, { signal: controller.signal }).then((response) => { + if (!response.ok) throw new Error('applications'); + return response.json() as Promise; + }).then((value) => { setData(value); setState('ready'); }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState('error'); + }); + return () => controller.abort(); + }, [id]); + if (state === 'loading') return
    ; + if (state === 'error' || !data) return

    {copy.applications.errorTitle}

    {copy.applications.errorDetail}

    {copy.applications.backToList}
    ; + if (id) { + const detail = data as ApplicationDetail; + const app = detail.application; + return <>

    {copy.applications.detailEyebrow}

    {app.name}

    {copy.applications.detailIntro}

    {copy.applications.source}

    {detail.source?.id || copy.applications.unknown}

    {app.reasons?.map((reason) =>

    {presentReason(reason.code)}

    )}
    ; + } + const snapshot = data as ApplicationSnapshot; + return <>

    {copy.applications.eyebrow}

    {copy.applications.title}

    {copy.applications.intro}

    {copy.applications.source}

    {snapshot.source?.id || copy.applications.unknown}

    {snapshot.total} {copy.applications.rows}

    {copy.applications.list}

    {copy.applications.overview}

    {snapshot.applications.length === 0 ?

    {copy.applications.empty}

    : }
    ; +} diff --git a/apps/web/src/ArrayPage.tsx b/apps/web/src/ArrayPage.tsx new file mode 100644 index 0000000..571aa72 --- /dev/null +++ b/apps/web/src/ArrayPage.tsx @@ -0,0 +1,32 @@ +import { formatDateTime } from './locale'; +import { useEffect, useState } from 'react'; +import { copy } from './copy'; +import { presentArrayRole, presentStatus } from './presentation'; +import { SourceStatusDetails } from './SourceStatusDetails'; + +type Member = { id: string; name: string; role: string; state: string; capacityBytes: number; readBytes: number; writeBytes: number }; +type Check = { id: string; state: string; progressPercent: number; speedBytesPerSecond: number; errors: number; startedAt?: string; completedAt?: string }; +type ArraySnapshot = { contractVersion: string; source: { id: string; state: string; freshness: string; observedAt?: string; receivedAt?: string; reason?: string }; state: string; parity: { present: boolean; state: string; errors: number }; members?: Member[] | null; currentCheck?: Check; history?: Check[] | null }; + +function bytes(value: number): string { if (!Number.isFinite(value) || value < 0) return '—'; const units = ['B', 'KB', 'MB', 'GB', 'TB']; let scaled = value; let index = 0; while (scaled >= 1024 && index < units.length - 1) { scaled /= 1024; index += 1; } return scaled.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + ' ' + units[index]; } +function date(value?: string): string { return formatDateTime(value); } +function Badge({ label, ready }: { label: string; ready: boolean }) { return {label}; } + +export function ArrayPage() { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [snapshot, setSnapshot] = useState(null); + useEffect(() => { const controller = new AbortController(); fetch('/api/v1/array', { signal: controller.signal }).then((response) => { if (!response.ok) throw new Error('array'); return response.json() as Promise; }).then((data) => { setSnapshot(data); setState('ready'); }).catch((error: unknown) => { if (error instanceof DOMException && error.name === 'AbortError') return; setState('error'); }); return () => controller.abort(); }, []); + if (state === 'loading') return
    ; + if (state === 'error' || !snapshot) return

    {copy.array.errorTitle}

    {copy.array.errorDetail}

    ; + const available = snapshot.source?.state !== 'unknown' && snapshot.source?.freshness === 'fresh'; + const stateLabel = snapshot.state === 'operational' ? copy.array.operational : snapshot.state === 'degraded' ? copy.array.degraded : snapshot.state === 'missing' ? copy.array.missing : copy.array.unknown; + const members = Array.isArray(snapshot.members) ? snapshot.members : []; + const history = Array.isArray(snapshot.history) ? snapshot.history : []; + return <> +

    {copy.array.eyebrow}

    {copy.array.title}

    {copy.array.intro}

    +

    {copy.array.source}

    {snapshot.source?.id || copy.array.unknown}

    {copy.array.readOnly}

    +

    {copy.array.parity}

    {snapshot.parity.present ? copy.array.present : copy.array.notPresent}

    {presentStatus(snapshot.parity.state)} · {copy.array.errors}: {snapshot.parity.errors}

    {copy.array.members}

    {members.length}

    {members.filter((member) => member.state !== 'online').length} {copy.array.notOperational}

    {snapshot.currentCheck &&

    {copy.array.currentCheck}

    {snapshot.currentCheck.progressPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 })}%

    {presentStatus(snapshot.currentCheck.state)} · {bytes(snapshot.currentCheck.speedBytesPerSecond)}/s · {copy.array.errors}: {snapshot.currentCheck.errors}

    }
    +

    {copy.array.members}

    {copy.array.membersTitle}

    {members.length === 0 ?

    {copy.array.noMembers}

    :
    {members.map((member) => )}
    {copy.array.name}{copy.array.role}{copy.array.state}{copy.array.capacity}{copy.array.io}
    {member.name}{presentArrayRole(member.role)}{bytes(member.capacityBytes)}{bytes(member.readBytes)} gelezen / {bytes(member.writeBytes)} geschreven
    }
    +
    {copy.array.history}{history.length === 0 ?

    {copy.array.noHistory}

    :
    {history.map((check) => )}
    ID{copy.array.state}{copy.array.progress}{copy.array.speed}{copy.array.completed}
    {check.id}{presentStatus(check.state)}{check.progressPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 })}%{bytes(check.speedBytesPerSecond)}/s{date(check.completedAt)}
    }
    + ; +} diff --git a/apps/web/src/CapacityPage.tsx b/apps/web/src/CapacityPage.tsx new file mode 100644 index 0000000..5227f7f --- /dev/null +++ b/apps/web/src/CapacityPage.tsx @@ -0,0 +1,52 @@ +import { formatDateTime } from './locale'; +import { useEffect, useState } from 'react'; +import { copy } from './copy'; + +type Forecast = { + entityId: string; + name: string; + kind: string; + enabled: boolean; + method: string; + windowSeconds: number; + dataPoints: number; + confidence: string; + currentUsedBytes: number; + capacityBytes: number; + rateBytesPerDay: number; + daysToCapacity?: number; + projectedAt?: string; + reason?: string; +}; +type Snapshot = { contractVersion: string; generatedAt: string; policy: { enabled: boolean; windowSeconds: number; minPoints: number; method: string }; items: Forecast[]; qualifiedCount: number; reason?: string }; + +function formatBytes(value: number): string { if (!Number.isFinite(value) || value < 0) return '—'; const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; let amount = value; let index = 0; while (amount >= 1024 && index < units.length - 1) { amount /= 1024; index += 1; } return `${amount.toLocaleString('nl-BE', { maximumFractionDigits: 1 })} ${units[index]}`; } +function formatWindow(seconds: number): string { const days = Math.round(seconds / 86400); return `${days} ${days === 1 ? copy.capacity.day : copy.capacity.days}`; } +function formatDate(value?: string): string { return formatDateTime(value); } +function label(value: string): string { + const labels: Record = { + linear_median_rate: copy.capacity.linearMedian, insufficient_data: copy.capacity.insufficient, + disabled: copy.capacity.disabled, high: copy.capacity.high, medium: copy.capacity.medium, + low: copy.capacity.low, none: copy.capacity.none, insufficient_points: copy.capacity.insufficientPoints, + insufficient_time_span: copy.capacity.insufficientSpan, history_stale: copy.capacity.historyStale, + history_unavailable: copy.capacity.historyUnavailable, source_unavailable: copy.capacity.sourceUnavailable, + no_capacity_entities: copy.capacity.noEntities, capacity_unknown_or_reached: copy.capacity.capacityUnknown, + no_positive_growth: copy.capacity.noGrowth, bulk_import_detected: copy.capacity.bulkImport, + irregular_intervals: copy.capacity.irregular, disabled_by_policy: copy.capacity.disabledByPolicy, + }; + return labels[value] ?? copy.capacity.unknown; +} + +export function CapacityPage() { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [snapshot, setSnapshot] = useState(null); + useEffect(() => { const controller = new AbortController(); fetch('/api/v1/forecasts', { signal: controller.signal }).then((response) => { if (!response.ok) throw new Error('forecasts'); return response.json() as Promise; }).then((data) => { setSnapshot(data); setState('ready'); }).catch((error: unknown) => { if (error instanceof DOMException && error.name === 'AbortError') return; setState('error'); }); return () => controller.abort(); }, []); + if (state === 'loading') return
    ; + if (state === 'error' || !snapshot) return

    {copy.capacity.errorTitle}

    {copy.capacity.errorDetail}

    ; + return <>

    {copy.capacity.eyebrow}

    {copy.capacity.title}

    {copy.capacity.intro}

    {copy.capacity.policy}

    {snapshot.policy.enabled ? copy.capacity.enabled : copy.capacity.disabled}

    {copy.capacity.method}: {label(snapshot.policy.method)} · {copy.capacity.window}: {formatWindow(snapshot.policy.windowSeconds)} · {copy.capacity.minimum}: {snapshot.policy.minPoints}

    {copy.capacity.readOnly}

    {copy.capacity.observed}: {formatDate(snapshot.generatedAt)} · {snapshot.qualifiedCount ?? 0} {copy.capacity.items} · {snapshot.items.length} {copy.capacity.assessments}

    {snapshot.items.length ? snapshot.items.map((item) => ) : }
    ; +} + +function ForecastCard({ item }: { item: Forecast }) { + const qualified = item.confidence === 'high' || item.confidence === 'medium'; + return

    {item.kind === 'share' ? copy.capacity.share : item.kind}

    {item.name || item.entityId || copy.capacity.unknown}

    {label(item.confidence)}
    {copy.capacity.method}
    {label(item.method)}
    {copy.capacity.window}
    {formatWindow(item.windowSeconds)}
    {copy.capacity.points}
    {item.dataPoints}
    {copy.capacity.current}
    {formatBytes(item.currentUsedBytes)} / {item.capacityBytes > 0 ? formatBytes(item.capacityBytes) : '—'}
    {copy.capacity.rate}
    {qualified && item.rateBytesPerDay > 0 ? `${formatBytes(item.rateBytesPerDay)} / ${copy.capacity.day}` : '—'}
    {qualified && item.daysToCapacity !== undefined &&
    {copy.capacity.projected}
    {Math.round(item.daysToCapacity)} {copy.capacity.days} · {formatDate(item.projectedAt)}
    }

    {item.reason ? label(item.reason) : copy.capacity.qualified}

    ; +} diff --git a/apps/web/src/ContainerPage.tsx b/apps/web/src/ContainerPage.tsx new file mode 100644 index 0000000..f3272ae --- /dev/null +++ b/apps/web/src/ContainerPage.tsx @@ -0,0 +1,144 @@ +import { formatDateTime } from './locale'; +import { useDeferredValue, useEffect, useRef, useState } from 'react'; +import { copy } from './copy'; +import { queryValue, replaceListQuery } from './listQuery'; +import { presentReason, presentStatus } from './presentation'; + +type ContainerItem = { + id: string; + name: string; + image?: string; + imageDigest?: string; + state: string; + health: string; + intentionalStop: boolean; + metricsAvailable?: boolean; + lifecycleAvailable?: boolean; + uptimeSeconds: number; + restartCount: number; + exitCode: number; + cpuPercent: number; + memoryBytes: number; + memoryLimitBytes: number; + networkRxBytes: number; + networkTxBytes: number; + blockReadBytes: number; + blockWriteBytes: number; + project?: string; + ports?: Array<{ containerPort: number; hostPort?: number; protocol: string }>; +}; +type ContainerSnapshot = { source: { id: string; state: string; reason?: string }; containers: ContainerItem[]; total: number; nextCursor?: string }; + +function bytes(value: number): string { + if (!Number.isFinite(value) || value < 0) return '—'; + const units = ['B', 'KB', 'MB', 'GB', 'TB']; + let scaled = value; + let index = 0; + while (scaled >= 1024 && index < units.length - 1) { scaled /= 1024; index += 1; } + return scaled.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + ' ' + units[index]; +} +function duration(seconds: number): string { + if (!Number.isFinite(seconds) || seconds < 0) return '—'; + const hours = Math.floor(seconds / 3600); + return hours >= 24 ? Math.floor(hours / 24) + ' d ' + (hours % 24) + ' u' : hours + ' u'; +} +type BadgeTone = 'ready' | 'attention' | 'unknown'; +function Badge({ label, tone }: { label: string; tone: BadgeTone }) { + return {label}; +} +function runtimeTone(state: string, sourceHealthy = true): BadgeTone { + if (!sourceHealthy) return 'unknown'; + switch (state.toLowerCase()) { + case 'running': return 'ready'; + case 'restarting': case 'paused': case 'exited': case 'dead': case 'stopped': return 'attention'; + default: return 'unknown'; + } +} +function healthTone(health: string, sourceHealthy = true): BadgeTone { + if (!sourceHealthy) return 'unknown'; + switch (health.toLowerCase()) { + case 'healthy': return 'ready'; + case 'unhealthy': return 'attention'; + default: return 'unknown'; + } +} + +export function ContainerPage() { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [snapshot, setSnapshot] = useState(null); + const [query, setQuery] = useState(() => queryValue('q')); + const deferredQuery = useDeferredValue(query); + const [stateFilter, setStateFilter] = useState(() => queryValue('state')); + const [healthFilter, setHealthFilter] = useState(() => queryValue('health')); + const [sort, setSort] = useState(() => queryValue('sort', ['name', 'cpu', 'memory', 'state'], 'name')); + const [cursor, setCursor] = useState(() => queryValue('after')); + const [history, setHistory] = useState([]); + const pageStatus = useRef(null); + const [reload, setReload] = useState(0); + useEffect(() => { + const controller = new AbortController(); + setState((current) => current === 'ready' ? 'ready' : 'loading'); + const params = new URLSearchParams({ limit: '25', sort }); + if (deferredQuery.trim()) params.set('q', deferredQuery.trim()); + if (stateFilter) params.set('state', stateFilter); + if (healthFilter) params.set('health', healthFilter); + if (cursor) params.set('after', cursor); + replaceListQuery({ q: deferredQuery.trim(), state: stateFilter, health: healthFilter, sort: sort === 'name' ? '' : sort, after: cursor }); + fetch('/api/v1/containers?' + params, { signal: controller.signal }).then((response) => { + if (!response.ok) throw new Error('containers'); + return response.json() as Promise; + }).then((data) => { setSnapshot(data); setState('ready'); if (cursor) requestAnimationFrame(() => pageStatus.current?.focus()); }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState('error'); + }); + return () => controller.abort(); + }, [deferredQuery, stateFilter, healthFilter, sort, cursor, reload]); + const resetPage = () => { setCursor(''); setHistory([]); }; + const previous = () => { const prior = [...history]; setCursor(prior.pop() ?? ''); setHistory(prior); }; + const next = () => { if (!snapshot?.nextCursor) return; setHistory((values) => [...values, cursor]); setCursor(snapshot.nextCursor ?? ''); }; + if (state === 'loading') return
    ; + if (state === 'error' || !snapshot) return

    {copy.containers.errorTitle}

    {copy.containers.errorDetail}

    ; + const available = snapshot.source?.state === 'healthy'; + return <> +

    {copy.containers.eyebrow}

    {copy.containers.title}

    {copy.containers.intro}

    +

    {copy.containers.source}

    {snapshot.source?.id || copy.containers.unknown}

    {snapshot.source?.reason ? presentReason(snapshot.source.reason) : copy.containers.readOnly}

    {snapshot.total} {copy.containers.rows} · {copy.containers.limitNote}

    +
    +

    {copy.containers.list}

    {copy.containers.top}

    +
    event.preventDefault()}> + + + + +
    + {snapshot.containers.length === 0 ?

    {copy.containers.empty}

    : <>
    {snapshot.containers.map((item) => )}
    {copy.containers.name}{copy.containers.state}{copy.containers.health}{copy.containers.resources}{copy.containers.image}
    {item.name}{item.project || copy.containers.noProject} · {item.lifecycleAvailable ? duration(item.uptimeSeconds) : copy.containers.unknown}{item.metricsAvailable ? item.cpuPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%' : copy.containers.unknown}{item.metricsAvailable ? `${bytes(item.memoryBytes)} / ${bytes(item.memoryLimitBytes)}` : copy.containers.metricsUnavailable}{item.image || copy.containers.unknown}
      {snapshot.containers.map((item) =>
    • {item.name}
      {copy.containers.resources}
      {item.metricsAvailable ? `${item.cpuPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 })}% · ${bytes(item.memoryBytes)}` : copy.containers.unknown}
      {copy.containers.image}
      {item.image || copy.containers.unknown}
    • )}
    } + +
    + ; +} +type ContainerDetailResponse = { source: { id: string; state: string; freshness: string; observedAt?: string; receivedAt?: string; reason?: string }; container: ContainerItem }; + +export function ContainerDetailPage({ id }: { id: string }) { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [detail, setDetail] = useState(null); + useEffect(() => { + const controller = new AbortController(); + fetch('/api/v1/containers/' + encodeURIComponent(id), { signal: controller.signal }).then((response) => { + if (!response.ok) throw new Error('container-detail'); + return response.json() as Promise; + }).then((data) => { setDetail(data); setState('ready'); }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState('error'); + }); + return () => controller.abort(); + }, [id]); + if (state === 'loading') return
    ; + if (state === 'error' || !detail) return

    {copy.containers.errorTitle}

    {copy.containers.errorDetail}

    {copy.containers.backToList}
    ; + const item = detail.container; + const fresh = detail.source?.freshness === 'fresh'; + return <> +

    {copy.containers.detailEyebrow}

    {item.name}

    {copy.containers.detailIntro}

    +

    {copy.containers.source}

    {detail.source?.id || copy.containers.unknown}

    {detail.source?.reason ? presentReason(detail.source.reason) : (fresh ? copy.containers.fresh : copy.containers.stale)}

    {copy.containers.observed}: {detail.source?.observedAt ? formatDateTime(detail.source.observedAt) : '—'} · {fresh ? copy.containers.fresh : copy.containers.stale}

    {item.intentionalStop && {copy.containers.intentionalStop}}
    +

    {copy.containers.resources}

    {item.metricsAvailable ? item.cpuPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%' : copy.containers.unknown}

    {item.metricsAvailable ? `${bytes(item.memoryBytes)} / ${bytes(item.memoryLimitBytes)}` : copy.containers.metricsUnavailable} · {copy.containers.restarts}: {item.lifecycleAvailable ? item.restartCount : copy.containers.unknown}

    {copy.containers.image}

    {item.image || copy.containers.unknown}

    {item.project || copy.containers.noProject}

    +
    {copy.containers.technical}
    ID
    {item.id}
    {copy.containers.exitCode}
    {item.lifecycleAvailable ? item.exitCode : copy.containers.unknown}
    {copy.containers.network}
    {item.metricsAvailable ? `${bytes(item.networkRxBytes)} RX / ${bytes(item.networkTxBytes)} TX` : copy.containers.unknown}
    {copy.containers.blockIO}
    {item.metricsAvailable ? `${bytes(item.blockReadBytes)} read / ${bytes(item.blockWriteBytes)} write` : copy.containers.unknown}
    {copy.containers.digest}
    {item.imageDigest || copy.containers.noDigest}

    {copy.containers.ports}

    {item.ports?.length ?
      {item.ports.map((port) =>
    • {port.hostPort || '—'} → {port.containerPort}/{port.protocol}
    • )}
    :

    {copy.containers.noData}

    }
    + ; +} diff --git a/apps/web/src/DashboardEditor.tsx b/apps/web/src/DashboardEditor.tsx new file mode 100644 index 0000000..f85ff97 --- /dev/null +++ b/apps/web/src/DashboardEditor.tsx @@ -0,0 +1,244 @@ +import { useRef, useState, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from 'react'; +import { copy } from './copy'; +import { WidgetConfigDrawer, type PreviewResult, type ValidationErrors } from './WidgetConfigDrawer'; +import { DashboardVariablesEditor, validateVariables, type DashboardVariable } from './DashboardVariablesEditor'; +import { DashboardTransfer } from './DashboardTransfer'; + +export type RecordValue = Record; +export type EditorWidget = { id: string; type: string; title: string; description?: string; data?: RecordValue; visualization?: RecordValue; behavior?: RecordValue; layouts?: RecordValue }; +type EditorProps = { dashboardId: string; revision: number; document: RecordValue; onExit: () => void; onSaved: (revision: number, document: RecordValue) => void }; + +const shell = copy.editor.shell; +const cardCopy = copy.editor.card; +const messages = copy.editor.messages; +const validation = copy.editor.validation; +const widgetTypeCopy = copy.editor.widgetTypes; + +export const types = ['stat', 'timeseries', 'gauge', 'ranked-list', 'status-grid', 'table', 'heatmap', 'event-timeline', 'storage-map', 'topology', 'service-matrix', 'alert-summary', 'text', 'query-inspector']; +export const labels: Record = { stat: widgetTypeCopy.stat, timeseries: widgetTypeCopy.timeseries, gauge: widgetTypeCopy.gauge, 'ranked-list': widgetTypeCopy.rankedList, 'status-grid': widgetTypeCopy.statusGrid, table: widgetTypeCopy.table, heatmap: widgetTypeCopy.heatmap, 'event-timeline': widgetTypeCopy.eventTimeline, 'storage-map': widgetTypeCopy.storageMap, topology: widgetTypeCopy.topology, 'service-matrix': widgetTypeCopy.serviceMatrix, 'alert-summary': widgetTypeCopy.alertSummary, text: widgetTypeCopy.text }; +const sourceTypes = ['semantic-metric', 'inventory', 'events', 'alerts', 'incidents', 'text']; +const ranges = ['live', '15m', '1h', '6h', '24h', '7d']; +const aggregations = ['avg', 'min', 'max', 'sum', 'last']; +type Viewport = 'desktop' | 'tablet' | 'mobile' | 'wallboard'; +const viewports: Viewport[] = ['desktop', 'tablet', 'mobile', 'wallboard']; +const viewportLabels: Record = { desktop: copy.editor.viewports.desktop, tablet: copy.editor.viewports.tablet, mobile: copy.editor.viewports.mobile, wallboard: copy.editor.viewports.wallboard }; +const viewportColumns: Record = { desktop: 18, tablet: 8, mobile: 1, wallboard: 24 }; + +function read(value: RecordValue | undefined, name: string): T | undefined { + if (!value) return undefined; + const upper = name.charAt(0).toUpperCase() + name.slice(1); + return (value[name] ?? value[upper] ?? value[name.toUpperCase()]) as T | undefined; +} +function copyWidget(value: EditorWidget): EditorWidget { return JSON.parse(JSON.stringify(value)) as EditorWidget; } +function widgetId(): string { return typeof crypto.randomUUID === 'function' ? crypto.randomUUID() : 'widget-' + Date.now().toString(36); } +function layout(widget: EditorWidget, viewport: Viewport = 'desktop'): RecordValue { + const layouts = widget.layouts ?? {}; + const fallback = read(layouts, 'desktop') ?? {}; + return { ...fallback, ...(read(layouts, viewport) ?? {}) }; +} +function withLayout(widget: EditorWidget, viewport: Viewport, nextLayout: RecordValue): EditorWidget { + return { ...widget, layouts: { ...(widget.layouts ?? {}), [viewport]: nextLayout } }; +} +function layoutWidth(widget: EditorWidget, viewport: Viewport): number { + return Math.min(viewportColumns[viewport], Math.max(1, Number(layout(widget, viewport).w ?? 6) || 1)); +} +function normalizeWidget(widget: EditorWidget, index: number): EditorWidget { + const base = { x: 0, y: index * 4, w: widget.type === 'timeseries' ? 9 : 6, h: 4, visible: true }; + const layouts = widget.layouts ?? {}; + const desktop = { ...base, ...(read(layouts, 'desktop') ?? {}) }; + const tablet = { ...desktop, ...(read(layouts, 'tablet') ?? {}) }; + const mobile = { ...desktop, ...(read(layouts, 'mobile') ?? {}), w: 1 }; + const wallboard = { ...desktop, ...(read(layouts, 'wallboard') ?? {}) }; + return { ...widget, data: { sourceType: 'inventory', limit: 100, ...(widget.data ?? {}) }, visualization: { decimals: 0, thresholds: [], ...(widget.visualization ?? {}) }, behavior: { locked: false, hidden: false, liveIntervalSeconds: 30, ...(widget.behavior ?? {}) }, layouts: { desktop, tablet, mobile, wallboard } }; +} +function newWidget(type: string, index: number): EditorWidget { + const baseLayout = { x: 0, y: index * 4, w: type === 'timeseries' ? 9 : 6, h: 4, visible: true }; + return { id: widgetId(), type, title: labels[type] ?? widgetTypeCopy.newWidget, data: { sourceType: type === 'text' ? 'text' : 'inventory', limit: 100 }, visualization: { decimals: 0, thresholds: [] }, behavior: { locked: false, hidden: false, hideWhenEmpty: false, showOnlyOnProblem: false, liveIntervalSeconds: 30 }, layouts: { desktop: baseLayout, tablet: baseLayout, mobile: { ...baseLayout, w: 1 }, wallboard: baseLayout } }; +} + +function numberValue(value: unknown): number | undefined { + return typeof value === 'number' && Number.isFinite(value) ? value : undefined; +} +export function validateWidget(widget: EditorWidget): ValidationErrors { + const errors: ValidationErrors = {}; + if (!widget.id.trim()) errors.id = validation.idRequired; + if (!types.includes(widget.type)) errors.type = validation.typeUnsupported; + if (!widget.title.trim()) errors.title = validation.titleRequired; + if (widget.title.length > 120) errors.title = validation.titleTooLong; + const data = widget.data ?? {}; + const source = typeof data.sourceType === 'string' ? data.sourceType : ''; + if (!sourceTypes.includes(source)) errors['data.sourceType'] = validation.sourceUnsupported; + if (source === 'semantic-metric') { + const metric = typeof data.metric === 'string' ? data.metric.trim() : ''; + if (!metric) errors['data.metric'] = validation.metricRequired; + if (/promql|query=/i.test(metric)) errors['data.metric'] = validation.metricNoPromql; + } + if (typeof data.range === 'string' && data.range && !ranges.includes(data.range) && !data.range.startsWith('$')) errors['data.range'] = validation.rangeUnsupported; + if (typeof data.aggregation === 'string' && data.aggregation && !aggregations.includes(data.aggregation)) errors['data.aggregation'] = validation.aggregationUnsupported; + const limit = numberValue(data.limit); + if (limit !== undefined && (!Number.isInteger(limit) || limit < 1 || limit > 1000)) errors['data.limit'] = validation.limitRange; + const visualization = widget.visualization ?? {}; + const decimals = numberValue(visualization.decimals); + if (decimals !== undefined && (!Number.isInteger(decimals) || decimals < 0 || decimals > 6)) errors['visualization.decimals'] = validation.decimalsRange; + const minimum = numberValue(visualization.min); + const maximum = numberValue(visualization.max); + if (minimum !== undefined && maximum !== undefined && minimum > maximum) errors['visualization.max'] = validation.maxBelowMin; + const interval = numberValue((widget.behavior ?? {}).liveIntervalSeconds); + if (interval !== undefined && (!Number.isInteger(interval) || interval < 1 || interval > 300)) errors['behavior.liveIntervalSeconds'] = validation.intervalRange; + return errors; +} + +export function DashboardEditor({ dashboardId, revision, document, onExit, onSaved }: EditorProps) { + const initial = (read(document, 'widgets') ?? []) as EditorWidget[]; + const initialVariables = (read(document, 'variables') ?? []) as DashboardVariable[]; + const [draft, setDraft] = useState(initial.map((widget, index) => normalizeWidget(copyWidget(widget), index))); + const [variables, setVariables] = useState(initialVariables.map((variable) => ({ ...variable, options: variable.options ? [...variable.options] : undefined }))); + const [history, setHistory] = useState([]); + const [future, setFuture] = useState([]); + const [savedSnapshot, setSavedSnapshot] = useState(() => JSON.stringify({ widgets: initial.map((widget, index) => normalizeWidget(copyWidget(widget), index)), variables: initialVariables })); + const [confirmExit, setConfirmExit] = useState(false); + const [conflict, setConflict] = useState(false); + const [selected, setSelected] = useState(initial[0]?.id ?? null); + const [newType, setNewType] = useState(types[0]); + const [activeViewport, setActiveViewport] = useState(() => window.innerWidth <= 700 ? 'mobile' : 'desktop'); + const [dragged, setDragged] = useState(null); + const [saving, setSaving] = useState(false); + const [message, setMessage] = useState(''); + const [preview, setPreview] = useState(null); + const [previewFor, setPreviewFor] = useState(null); + const [previewState, setPreviewState] = useState('loading'); + const [previewing, setPreviewing] = useState(false); + const [previewError, setPreviewError] = useState(''); + const resize = useRef<{ id: string; x: number; w: number } | null>(null); + const drag = useRef<{ id: string; y: number } | null>(null); + + const update = (id: string, change: (widget: EditorWidget) => EditorWidget) => applyDraft((items) => items.map((item) => item.id === id ? change(item) : item)); + const selectedWidget = draft.find((item) => item.id === selected); + const dirty = JSON.stringify({ widgets: draft, variables }) !== savedSnapshot; + const applyDraft = (change: (items: EditorWidget[]) => EditorWidget[]): void => setDraft((items) => { + const next = change(items); + if (next === items) return items; + setHistory((entries) => [...entries, items.map(copyWidget)].slice(-50)); + setFuture([]); + return next; + }); + const selectedErrors = selectedWidget ? validateWidget(selectedWidget) : {}; + const updateSelected = (next: EditorWidget) => { setPreview(null); setPreviewFor(null); setPreviewError(''); if (selected) update(selected, () => next); }; + const move = (id: string, direction: -1 | 1) => applyDraft((items) => { + const index = items.findIndex((item) => item.id === id); + const next = index + direction; + if (index < 0 || next < 0 || next >= items.length || read(items[index].behavior, 'locked')) return items; + const copy = [...items]; const [item] = copy.splice(index, 1); copy.splice(next, 0, item); return copy; + }); + const onWidgetPointerDown = (event: ReactPointerEvent, id: string, locked: boolean) => { + if (locked || (event.target as HTMLElement).closest('button, input, select, textarea')) return; + event.currentTarget.setPointerCapture(event.pointerId); + drag.current = { id, y: event.clientY }; + setDragged(id); + }; + const onWidgetPointerMove = (event: ReactPointerEvent, id: string) => { + const active = drag.current; + if (!active || active.id !== id) return; + const delta = event.clientY - active.y; + if (Math.abs(delta) < 28) return; + move(id, delta > 0 ? 1 : -1); + drag.current = { id, y: event.clientY }; + }; + const onWidgetPointerUp = (event: ReactPointerEvent) => { + drag.current = null; + setDragged(null); + if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId); + }; + const duplicate = (id: string) => applyDraft((items) => { + const source = items.find((item) => item.id === id); if (!source) return items; + const copy = copyWidget(source); copy.id = widgetId(); copy.title = copy.title + widgetTypeCopy.copySuffix; copy.behavior = { ...(copy.behavior ?? {}), locked: false, hidden: false }; return [...items, copy]; + }); + const remove = (id: string) => { applyDraft((items) => items.filter((item) => item.id !== id)); setSelected((value) => value === id ? null : value); }; + const add = () => { const item = newWidget(newType, draft.length); applyDraft((items) => [...items, item]); setSelected(item.id); }; + // Single width mutation used by the pointer handle, the arrow keys and the + // width field in the configuration drawer, so all three stay in step. + const setWidgetWidth = (id: string, next: number) => { + if (!Number.isFinite(next)) return; + const width = Math.min(viewportColumns[activeViewport], Math.max(1, Math.round(next))); + update(id, (item) => withLayout(item, activeViewport, { ...layout(item, activeViewport), w: width })); + }; + const onResizeMove = (event: ReactPointerEvent) => { + const active = resize.current; if (!active) return; + setWidgetWidth(active.id, active.w + Math.round((event.clientX - active.x) / 48)); + }; + // Keyboard alternative for the pointer-only resize handle (UX_SPEC 5 and 12). + const onResizeKeyDown = (event: ReactKeyboardEvent, id: string, current: number) => { + const max = viewportColumns[activeViewport]; + const step = event.key === 'ArrowRight' || event.key === 'ArrowUp' ? 1 : event.key === 'ArrowLeft' || event.key === 'ArrowDown' ? -1 : 0; + if (step === 0 && event.key !== 'Home' && event.key !== 'End') return; + event.preventDefault(); + event.stopPropagation(); + setWidgetWidth(id, event.key === 'Home' ? 1 : event.key === 'End' ? max : current + step); + }; + const undo = () => { + const previous = history[history.length - 1]; + if (!previous) return; + setHistory((entries) => entries.slice(0, -1)); + setFuture((entries) => [draft.map(copyWidget), ...entries].slice(0, 50)); + setDraft(previous.map(copyWidget)); + }; + const redo = () => { + const next = future[0]; + if (!next) return; + setFuture((entries) => entries.slice(1)); + setHistory((entries) => [...entries, draft.map(copyWidget)].slice(-50)); + setDraft(next.map(copyWidget)); + }; + const requestExit = () => { if (dirty) setConfirmExit(true); else onExit(); }; + const importDocument = (nextDocument: RecordValue) => { + const importedWidgets = (read(nextDocument, 'widgets') ?? []) as EditorWidget[]; + const importedVariables = (read(nextDocument, 'variables') ?? []) as DashboardVariable[]; + setDraft(importedWidgets.map((widget, index) => normalizeWidget(copyWidget(widget), index))); + setVariables(importedVariables); + setHistory([]); setFuture([]); setMessage(messages.importLoaded); + }; + const reloadServer = async () => { + try { + const response = await fetch('/api/v1/dashboards/' + encodeURIComponent(dashboardId)); + if (!response.ok) throw new Error('reload'); + const data = await response.json() as { version?: RecordValue }; + const serverDocument = read(data.version, 'document') ?? {}; + const serverWidgets = (read(serverDocument, 'widgets') ?? []) as EditorWidget[]; + const next = serverWidgets.map((widget, index) => normalizeWidget(copyWidget(widget), index)); + const nextVariables = (read(serverDocument, 'variables') ?? []) as DashboardVariable[]; + setDraft(next); setVariables(nextVariables); setSavedSnapshot(JSON.stringify({ widgets: next, variables: nextVariables })); setHistory([]); setFuture([]); setConflict(false); setMessage(messages.serverLoaded); + } catch { setMessage(messages.serverLoadFailed); } + }; + const previewSelected = async () => { + if (!selectedWidget || Object.keys(selectedErrors).length > 0) { setPreviewError(messages.previewBlocked); return; } + setPreviewing(true); setPreviewError(''); + try { + const response = await fetch('/api/v1/dashboards/' + encodeURIComponent(dashboardId) + '/preview', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ widget: selectedWidget, state: previewState }) }); + const data = await response.json() as { preview?: PreviewResult; detail?: string }; + if (!response.ok || !data.preview) { setPreviewError(data.detail ?? messages.previewFailed); return; } + setPreview(data.preview); setPreviewFor(selectedWidget.id); + } catch { setPreviewError(messages.previewFailedConnection); } finally { setPreviewing(false); } + }; + const save = async () => { + const invalid = draft.map((widget) => ({ widget, errors: validateWidget(widget) })).find((item) => Object.keys(item.errors).length > 0); + if (invalid) { setSelected(invalid.widget.id); setMessage(messages.saveBlockedWidgets); return; } + if (Object.keys(validateVariables(variables)).length > 0) { setMessage(messages.saveBlockedVariables); return; } + setSaving(true); setMessage(''); + const body = { ...document, widgets: draft, variables }; + try { + const response = await fetch('/api/v1/dashboards/' + encodeURIComponent(dashboardId) + '/document', { method: 'PUT', headers: { 'Content-Type': 'application/json', 'If-Match': String(revision) }, body: JSON.stringify(body) }); + if (!response.ok) { if (response.status === 409) { setConflict(true); setMessage(messages.saveConflict); } else setMessage(messages.saveFailed); return; } + const data = await response.json() as RecordValue; + const summary = read(data, 'dashboard') ?? {}; + setSavedSnapshot(JSON.stringify({ widgets: body.widgets, variables: body.variables })); setConflict(false); onSaved(Number(read(summary, 'revision') ?? revision + 1), body); + } catch { setMessage(messages.saveFailedConnection); } finally { setSaving(false); } + }; + + return
    +

    {shell.eyebrow}

    {shell.title}

    {shell.intro}

    {dirty &&

    {shell.dirty}

    }
    + {conflict &&
    {shell.conflictTitle}{shell.conflictDetail}
    }{confirmExit &&
    {shell.confirmExitTitle}{shell.confirmExitDetail}
    }
    {shell.advanced}
    {message &&

    {message}

    }
    +

    {shell.canvas}

    + {draft.map((widget) => { const activeLayout = layout(widget, activeViewport); const locked = read(widget.behavior, 'locked') === true; const viewportHidden = read(activeLayout, 'visible') === false; const hidden = read(widget.behavior, 'hidden') === true || viewportHidden; const errors = validateWidget(widget); const width = layoutWidth(widget, activeViewport); return
    onWidgetPointerDown(event, widget.id, locked)} onPointerMove={(event) => onWidgetPointerMove(event, widget.id)} onPointerUp={onWidgetPointerUp} onPointerCancel={onWidgetPointerUp} onClick={() => { setSelected(widget.id); setPreview(null); setPreviewFor(null); }}>

    {labels[widget.type] ?? widgetTypeCopy.fallback}

    {widget.title || widgetTypeCopy.untitled}

    {locked ? cardCopy.locked : cardCopy.movable}

    {cardCopy.resizeHint}

    {Object.keys(errors).length > 0 &&

    {cardCopy.incompleteConfig}

    }

    {locked ? cardCopy.lockedHint : cardCopy.dragHint}

    ; })} +
    {selectedWidget ? setWidgetWidth(selectedWidget.id, value)} onPreviewStateChange={setPreviewState} onPreview={previewSelected} /> : }
    +
    ; +} diff --git a/apps/web/src/DashboardRuntimeWidget.tsx b/apps/web/src/DashboardRuntimeWidget.tsx new file mode 100644 index 0000000..571951c --- /dev/null +++ b/apps/web/src/DashboardRuntimeWidget.tsx @@ -0,0 +1,141 @@ +import { useEffect, useMemo, useState, type CSSProperties } from 'react'; +import { resolveDashboardScope } from './dashboardScope'; +import { LiveChartAdapter, historicalSamplesFromData, type LiveFreshness } from './liveBuffer'; +import { LiveClient } from './liveClient'; +import { MetricClient, rangeForPreset, type MetricQueryRequest, type MetricRangePreset } from './metricClient'; +import { MetricWidget, StatusGridWidget, type MetricWidgetProps, type StatusGridItem } from './MetricWidgets'; +import { buildStorageNodes, type StorageData } from './StoragePage'; +import { StorageMapWidget } from './StorageVisuals'; +import { aggregateStatus, useSystemStatus } from './systemStatus'; +import { useLiveMetric } from './useLiveMetric'; +import { useMetricQuery } from './useMetricQuery'; +import { formatDateTime } from './locale'; +import { copy } from './copy'; +import { presentEventSummary, presentEventType, presentReason, presentStatus } from './presentation'; +import { wallboardColumns, wallboardPlacement } from './wallboardLayout'; + +type RecordValue = Record; +export type RuntimeWidget = { id: string; type: string; title: string; description?: string; data?: RecordValue; visualization?: RecordValue; behavior?: RecordValue; layouts?: RecordValue }; +export type RuntimeState = 'loading' | 'usable' | 'empty' | 'error'; + +const metricClient = new MetricClient(); +const liveClient = new LiveClient(); + +function field(record: RecordValue | undefined, name: string): T | undefined { + if (!record) return undefined; + const upper = name.charAt(0).toUpperCase() + name.slice(1); + return (record[name] ?? record[upper] ?? record[name.toUpperCase()]) as T | undefined; +} + +function Badge({ state }: { state: RuntimeState }) { + const usable = state === 'usable'; + const label = usable ? copy.dashboards.runtime.current : state === 'loading' ? copy.dashboards.runtime.loading : state === 'empty' ? copy.dashboards.runtime.empty : copy.dashboards.runtime.error; + return {label}; +} + +type Resource = { state: RuntimeState; items?: StatusGridItem[]; storage?: StorageData; events?: EventItem[]; error?: string }; +type EventItem = { id: string; type: string; severity: string; summary: string; occurredAt: string; sourceId?: string }; + +function useInventoryResource(widget: RuntimeWidget): Resource { + const [resource, setResource] = useState({ state: 'loading' }); + const sourceType = String(field(widget.data, 'sourceType') ?? ''); + const scope = field(widget.data, 'scope') ?? {}; + const entityType = String(field(scope, 'entityType') ?? ''); + const isApplications = sourceType === 'inventory' && entityType === 'application'; + const isStorage = sourceType === 'inventory' && Array.isArray(field(scope, 'entityTypes')); + const isEvents = sourceType === 'events'; + const interval = Math.min(300, Math.max(5, Number(field(widget.behavior, 'liveIntervalSeconds') ?? 15))) * 1000; + + useEffect(() => { + if (!isApplications && !isStorage && !isEvents) { + setResource({ state: 'empty' }); + return undefined; + } + let active = true; + let controller: AbortController | null = null; + const read = async (url: string, signal: AbortSignal): Promise => { + const response = await fetch(url, { signal, cache: 'no-store' }); + if (!response.ok) throw new Error(`HTTP ${response.status}`); + return response.json() as Promise; + }; + const load = async () => { + controller?.abort(); + const current = new AbortController(); + controller = current; + try { + if (isApplications) { + const value = await read<{ applications?: Array<{ id: string; name: string; status: string; reasons?: Array<{ message?: string }> }> }>('/api/v1/applications', current.signal); + const items = (value.applications ?? []).slice(0, 50).map((item) => ({ id: item.id, label: item.name, status: presentStatus(item.status), reason: presentReason(item.reasons?.[0]?.message) })); + if (active) setResource({ state: items.length ? 'usable' : 'empty', items }); + } else if (isStorage) { + const [array, disks, pools] = await Promise.all([ + read('/api/v1/array', current.signal), + read('/api/v1/disks?limit=100', current.signal), + read('/api/v1/pools?limit=100', current.signal), + ]); + const storage = { array, disks, pools }; + if (active) setResource({ state: buildStorageNodes(storage).length ? 'usable' : 'empty', storage }); + } else { + const limit = Math.min(100, Math.max(1, Number(field(widget.data, 'limit') ?? 100))); + const value = await read<{ items?: EventItem[] }>('/api/v1/events?limit=' + limit, current.signal); + const events = (value.items ?? []).slice(0, limit); + if (active) setResource({ state: events.length ? 'usable' : 'empty', events }); + } + } catch (error: unknown) { + if (error instanceof DOMException && error.name === 'AbortError') return; + if (active) setResource({ state: 'error', error: error instanceof Error ? error.message : 'bron niet beschikbaar' }); + } + }; + void load(); + const timer = window.setInterval(load, interval); + return () => { active = false; controller?.abort(); window.clearInterval(timer); }; + }, [isApplications, isStorage, isEvents, interval, widget.data]); + return resource; +} + +export function DashboardRuntimeWidget({ widget, viewport, document, timeRange, onState, onFilter }: { widget: RuntimeWidget; viewport: 'desktop' | 'tablet' | 'mobile' | 'wallboard'; document: RecordValue; timeRange: string; onState: (id: string, state: RuntimeState) => void; onFilter: () => void }) { + const sourceType = String(field(widget.data, 'sourceType') ?? ''); + const semantic = sourceType === 'semantic-metric'; + const system = useSystemStatus(); + const inventory = useInventoryResource(widget); + const range = useMemo(() => rangeForPreset(timeRange as MetricRangePreset), [timeRange]); + const request = useMemo(() => { + if (!semantic) return null; + const metric = String(field(widget.data, 'metric') ?? ''); + if (!metric) return null; + const scope = resolveDashboardScope(field(widget.data, 'scope') ?? {}, field(document, 'variables') ?? []); + return { metric, scope, range, aggregation: String(field(widget.data, 'aggregation') ?? 'avg') }; + }, [semantic, widget.data, document, range]); + const metricState = useMetricQuery(metricClient, request); + const historicalSamples = useMemo(() => metricState.status === 'success' ? historicalSamplesFromData(metricState.response?.data) : [], [metricState.status, metricState.response?.data]); + const freshness: LiveFreshness = metricState.response?.freshness ?? 'unavailable'; + const historicalSeries = useMemo(() => { const adapter = new LiveChartAdapter(4000); adapter.append(historicalSamples.map((sample) => ({ ...sample, freshness }))); return adapter.snapshot(); }, [historicalSamples, freshness]); + const live = useLiveMetric(liveClient, semantic && timeRange === 'live' ? request : null, historicalSamples); + const systemWidget = sourceType === 'inventory' && String(field(field(widget.data, 'scope'), 'entityType') ?? '') === 'server'; + const systemStatus = aggregateStatus(system); + const metricRuntime: RuntimeState = metricState.status === 'error' || (timeRange === 'live' && live.state === 'error') ? 'error' : (timeRange === 'live' ? live.series.length : historicalSeries.length) > 0 ? 'usable' : metricState.status === 'loading' || (timeRange === 'live' && live.state === 'connecting') ? 'loading' : 'empty'; + const runtime = semantic ? metricRuntime : systemWidget ? (system.state === 'loading' ? 'loading' : system.state === 'ready' ? 'usable' : 'error') : inventory.state; + useEffect(() => { onState(widget.id, runtime); }, [onState, runtime, widget.id]); + + const activeLayout = field(widget.layouts, viewport) ?? field(widget.layouts, 'desktop') ?? {}; + const columns = viewport === 'wallboard' ? wallboardColumns : viewport === 'tablet' ? 8 : viewport === 'mobile' ? 1 : 18; + const width = viewport === 'mobile' ? 1 : Math.min(columns, Math.max(1, Number(field(activeLayout, 'w') ?? 6))); + const placement = wallboardPlacement(activeLayout); + const layoutStyle = viewport === 'wallboard' ? { '--widget-span': String(placement.columnSpan), gridColumn: `${placement.columnStart} / span ${placement.columnSpan}`, gridRow: `${placement.rowStart} / span ${placement.rowSpan}` } as CSSProperties : { '--widget-span': String(width) } as CSSProperties; + let content; + if (semantic) { + const metric: MetricWidgetProps = { kind: widget.type as MetricWidgetProps['kind'], series: timeRange === 'live' ? live.series : historicalSeries, freshness, expectedStepSeconds: request?.range.stepSeconds ?? 15, availability: timeRange === 'live' ? live.state : metricState.status, error: timeRange === 'live' ? live.error : metricState.error?.actionable ?? null, visualization: widget.visualization, metricName: request?.metric, sourceObservedAt: metricState.response?.sourceObservedAt, receivedAt: metricState.response?.receivedAt, warnings: metricState.response?.warnings, inspector: metricState.response?.inspector }; + content = ; + } else if (systemWidget && system.state === 'ready') { + content =
    {systemStatus.label}{systemStatus.detail}{system.status?.components.length ?? 0} {copy.dashboards.runtime.checkedComponents}
    ; + } else if (inventory.items?.length) { + content = ; + } else if (inventory.storage) { + content = ; + } else if (inventory.events?.length) { + content =
      {inventory.events.slice(0, viewport === 'mobile' ? 6 : 12).map((event) =>
    1. )}
    ; + } else { + content =
    {runtime === 'error' ? copy.dashboards.runtime.sourceUnavailable : runtime === 'loading' ? copy.dashboards.runtime.telemetryLoading : copy.dashboards.runtime.noCurrentData}{runtime === 'error' ? copy.dashboards.runtime.unavailableDetail : copy.dashboards.runtime.retryDetail}
    ; + } + return

    {sourceType === 'semantic-metric' ? copy.dashboards.runtime.semanticMetric : sourceType === 'events' ? copy.dashboards.runtime.events : copy.dashboards.runtime.inventory}

    {widget.title}

    {widget.description &&

    {widget.description}

    }{content}
    ; +} diff --git a/apps/web/src/DashboardTransfer.tsx b/apps/web/src/DashboardTransfer.tsx new file mode 100644 index 0000000..7c87c9d --- /dev/null +++ b/apps/web/src/DashboardTransfer.tsx @@ -0,0 +1,50 @@ +import { copy } from './copy'; +import type { RecordValue } from './DashboardEditor'; + +export type TransferResult = { document: RecordValue; errors: string[] }; + +const transferCopy = copy.editor.transfer; + +function hasUnsafeText(value: unknown): boolean { + if (typeof value === 'string') return /<\s*script|<\s*iframe|javascript:/i.test(value); + if (Array.isArray(value)) return value.some(hasUnsafeText); + if (value && typeof value === 'object') return Object.values(value as RecordValue).some(hasUnsafeText); + return false; +} +function depth(value: unknown, current = 0): number { + if (!value || typeof value !== 'object') return current; + const children = Array.isArray(value) ? value : Object.values(value as RecordValue); + return children.reduce((max, child) => Math.max(max, depth(child, current + 1)), current); +} +export function validatePortableDashboard(value: unknown): TransferResult { + const errors: string[] = []; + if (!value || typeof value !== 'object' || Array.isArray(value)) return { document: {}, errors: [transferCopy.errors.notAnObject] }; + const document = value as RecordValue; + const schemaVersion = document.schemaVersion; + if (schemaVersion !== 1 && schemaVersion !== 2) errors.push(transferCopy.errors.schemaVersion); + const widgets = Array.isArray(document.widgets) ? document.widgets : []; + const variables = Array.isArray(document.variables) ? document.variables : []; + if (!Array.isArray(document.widgets)) errors.push(transferCopy.errors.widgetsArray); + if (!Array.isArray(document.variables)) errors.push(transferCopy.errors.variablesArray); + if (widgets.length > 200) errors.push(transferCopy.errors.tooManyWidgets); + if (variables.length > 30) errors.push(transferCopy.errors.tooManyVariables); + if (depth(value) > 12) errors.push(transferCopy.errors.tooDeep); + if (hasUnsafeText(value)) errors.push(transferCopy.errors.unsafeContent); + return { document, errors }; +} +export function parsePortableDashboard(text: string): TransferResult { + if (text.length > 2 * 1024 * 1024) return { document: {}, errors: [transferCopy.errors.tooLarge] }; + try { return validatePortableDashboard(JSON.parse(text)); } catch { return { document: {}, errors: [transferCopy.errors.invalidJson] }; } +} + +type Props = { document: RecordValue; onImport: (document: RecordValue) => void }; +const templateLabels: Record = { empty: transferCopy.templateEmpty, operations: transferCopy.templateOperations }; +const templates: Record = { + empty: { schemaVersion: 2, id: '00000000-0000-0000-0000-000000000000', slug: 'nieuw-dashboard', name: transferCopy.templateEmptyName, scope: 'personal', variables: [], widgets: [], settings: { defaultTimeRange: '1h' } }, + operations: { schemaVersion: 2, id: '00000000-0000-0000-0000-000000000000', slug: 'operations-template', name: transferCopy.templateOperations, scope: 'personal', variables: [{ name: 'timeRange', type: 'time-range', label: copy.editor.variables.periodLabel, default: '1h', options: ['live', '15m', '1h', '6h', '24h', '7d'] }], widgets: [], settings: { defaultTimeRange: '1h' } } +}; +export function DashboardTransfer({ document, onImport }: Props) { + const exportDocument = () => { const blob = new Blob([JSON.stringify(document, null, 2)], { type: 'application/json' }); const url = URL.createObjectURL(blob); const link = window.document.createElement('a'); link.href = url; link.download = 'pulse-dashboard.json'; link.click(); URL.revokeObjectURL(url); }; + const importDocument = async (file: File) => { const result = parsePortableDashboard(await file.text()); if (result.errors.length) { window.alert(result.errors.join(' ')); return; } onImport(result.document); }; + return

    {transferCopy.kicker}

    {transferCopy.title}

    {Object.entries(templates).map(([key, template]) => )}
    ; +} diff --git a/apps/web/src/DashboardVariablesEditor.tsx b/apps/web/src/DashboardVariablesEditor.tsx new file mode 100644 index 0000000..557d94a --- /dev/null +++ b/apps/web/src/DashboardVariablesEditor.tsx @@ -0,0 +1,41 @@ +import { copy } from './copy'; + +export type DashboardVariable = { name: string; type: string; label: string; default: string; options?: string[] }; + +export type VariableErrors = Record; +const variableTypes = ['server', 'entity', 'container', 'application', 'disk', 'pool', 'service', 'time-range', 'enum']; +const text = copy.editor.variables; + +export function validateVariables(variables: DashboardVariable[]): VariableErrors { + const errors: VariableErrors = {}; + if (variables.length > 30) errors.form = text.errors.tooMany; + const names = new Set(); + variables.forEach((variable, index) => { + const prefix = 'variables.' + index; + if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(variable.name)) errors[prefix + '.name'] = text.errors.nameFormat; + if (names.has(variable.name)) errors[prefix + '.name'] = text.errors.nameUnique; + names.add(variable.name); + if (!variableTypes.includes(variable.type)) errors[prefix + '.type'] = text.errors.typeUnsupported; + if (!variable.label.trim()) errors[prefix + '.label'] = text.errors.labelRequired; + if (variable.options && variable.options.length > 1000) errors[prefix + '.options'] = text.errors.tooManyOptions; + if ((variable.type === 'entity' || variable.type === 'server') && variable.options?.length && !variable.options.includes(variable.default)) errors[prefix + '.default'] = text.errors.defaultNotAllowed; + }); + return errors; +} + +type Props = { variables: DashboardVariable[]; onChange: (variables: DashboardVariable[]) => void }; + +export function DashboardVariablesEditor({ variables, onChange }: Props) { + const errors = validateVariables(variables); + const error = (key: string) => errors[key] ?

    {errors[key]}

    : null; + const update = (index: number, change: (variable: DashboardVariable) => DashboardVariable) => onChange(variables.map((variable, current) => current === index ? change(variable) : variable)); + const add = () => onChange([...variables, { name: 'variable' + (variables.length + 1), type: 'time-range', label: text.newLabel, default: '1h', options: ['live', '15m', '1h', '6h', '24h', '7d'] }]); + const remove = (index: number) => onChange(variables.filter((_, current) => current !== index)); + return
    +

    {text.kicker}

    {text.title}

    +

    {text.intro}

    + {errors.form &&

    {errors.form}

    } + {variables.length === 0 &&

    {text.empty}

    } +
    {variables.map((variable, index) => { const prefix = 'variables.' + index; const options = variable.options ?? []; return
    {error(prefix + '.name')}{error(prefix + '.label')}
    {error(prefix + '.type')}{error(prefix + '.default')}{error(prefix + '.options')}
    ; })}
    +
    ; +} diff --git a/apps/web/src/DiskPage.tsx b/apps/web/src/DiskPage.tsx new file mode 100644 index 0000000..e4a8f4f --- /dev/null +++ b/apps/web/src/DiskPage.tsx @@ -0,0 +1,15 @@ +import { formatDateTime } from './locale'; +import { useEffect, useState } from 'react'; +import { copy } from './copy'; +import { presentArrayRole, presentReason, presentStatus } from './presentation'; + +type SmartAttribute = { id:string; name:string; rawValue:number; normalizedValue?:number; unit?:string; status:string; critical:boolean; reason?:string }; type Smart = { state:string; overall:string; observedAt?:string; attributes:SmartAttribute[]; selfTest?:{supported:boolean;result:string;completedAt?:string;ageSeconds?:number}; reasons?:string[] }; type Sample = { observedAt:string; readBytesPerSecond?:number; writeBytesPerSecond?:number; readIops?:number; writeIops?:number; readLatencyMs?:number; writeLatencyMs?:number }; type Disk = { id:string; name:string; role:string; state:string; model?:string; serialDisplay?:string; filesystem?:string; sizeBytes:number; usedBytes:number; freeBytes:number; utilizationPercent:number; capacitySeverity?:string; thermalSeverity?:string; inodes?:{total:number;used:number;free:number;utilizationPercent:number}; smart?:Smart; performance?:{state:string;current:Sample;history:Sample[]}; temperature?:{state:string;celsius?:number;status:string;observedAt?:string}; spin?:{state:string} }; +type Snapshot = { source:{id:string;state:string;freshness:string;observedAt?:string;reason?:string}; disks:Disk[]; total:number; missingHistory?:Array<{diskId:string;name:string;role:string;observedAt:string;reason:string}> }; +type Detail = {source:Snapshot['source'];disk:Disk}; +function bytes(value:number):string{if(!Number.isFinite(value)||value<0)return'—';const units=['B','KB','MB','GB','TB'];let scaled=value;let index=0;while(scaled>=1024&&index{label}} +function severityLabel(value?:string):string{return value==='normal'?'Normaal':value==='attention'?'Aandacht':value==='critical'?'Kritiek':'Onbekend'} +function DiskCard({disk}:{disk:Disk}){return

    {presentArrayRole(disk.role)}

    {disk.name}

    {disk.filesystem||copy.disks.noFilesystem} · {bytes(disk.sizeBytes)} · {disk.utilizationPercent.toLocaleString('nl-BE',{maximumFractionDigits:1})}% {copy.disks.used}

    Capaciteit: {severityLabel(disk.capacitySeverity)} · Temperatuur: {severityLabel(disk.thermalSeverity)}

    {disk.model||copy.disks.noModel} · {disk.serialDisplay||copy.disks.noSerial}

    } +export function DiskPage(){const[state,setState]=useState<'loading'|'ready'|'error'>('loading');const[snapshot,setSnapshot]=useState(null);useEffect(()=>{const controller=new AbortController();fetch('/api/v1/disks?limit=100',{signal:controller.signal}).then(response=>{if(!response.ok)throw new Error('disks');return response.json() as Promise}).then(data=>{setSnapshot(data);setState('ready')}).catch(error=>{if(error instanceof DOMException&&error.name==='AbortError')return;setState('error')});return()=>controller.abort()},[]);if(state==='loading')return
    ;if(state==='error'||!snapshot)return

    {copy.disks.errorTitle}

    {copy.disks.errorDetail}

    ;const fresh=snapshot.source?.freshness==='fresh'&&snapshot.source?.state!=='unknown';return <>

    {copy.disks.eyebrow}

    {copy.disks.title}

    {copy.disks.intro}

    {copy.disks.source}

    {snapshot.source?.id||copy.disks.unknown}

    {snapshot.source?.reason?presentReason(snapshot.source.reason):(fresh?copy.disks.fresh:copy.disks.stale)}

    {copy.disks.observed}: {date(snapshot.source?.observedAt)} · {snapshot.total} {copy.disks.rows}

    {snapshot.disks.length?snapshot.disks.map(disk=>):

    {copy.disks.empty}

    }

    {copy.disks.history}

    {copy.disks.missingTitle}

    {snapshot.missingHistory?.length?
      {snapshot.missingHistory.map(item=>
    • {item.name}{item.role} · {presentReason(item.reason)} · {date(item.observedAt)}
    • )}
    :

    {copy.disks.noMissingHistory}

    }
    } +function TelemetrySection({performance,temperature,spin}:{performance?:Disk['performance'];temperature?:Disk['temperature'];spin?:Disk['spin']}){return

    {copy.disks.telemetry}

    {temperature?.celsius == null ? '—' : temperature.celsius.toLocaleString('nl-BE',{maximumFractionDigits:1})+' °C'}

    {copy.disks.spin}: {spin?.state==='unsupported'?copy.disks.unsupported:presentStatus(spin?.state)} · {copy.disks.performance}: {performance?.state==='unsupported'?copy.disks.unsupported:presentStatus(performance?.state)}

    {performance?.state==='available'&&

    {copy.disks.read}: {Math.round(performance.current.readBytesPerSecond||0).toLocaleString('nl-BE')} B/s · {copy.disks.write}: {Math.round(performance.current.writeBytesPerSecond||0).toLocaleString('nl-BE')} B/s · {performance.history.length} {copy.disks.historyPoints}

    }
    }function SmartSection({smart}:{smart?:Smart}){if(!smart)return

    SMART

    {copy.disks.smartUnavailable}

    ;return

    SMART

    {presentStatus(smart.overall)}

    {smart.reasons?.length?
      {smart.reasons.map(reason=>
    • {reason}
    • )}
    :

    {copy.disks.smartNoReasons}

    }{smart.selfTest&&

    {copy.disks.selfTest}: {smart.selfTest.result} · {smart.selfTest.ageSeconds == null ? '—' : Math.floor(smart.selfTest.ageSeconds/3600)+' u'}

    }{smart.attributes.length>0&&
    {smart.attributes.map(attribute=>)}
    {copy.disks.attribute}{copy.disks.value}{copy.disks.state}
    {attribute.name}{attribute.id}{attribute.rawValue}{attribute.unit?' '+attribute.unit:''}
    }
    }export function DiskDetailPage({id}:{id:string}){const[state,setState]=useState<'loading'|'ready'|'error'>('loading');const[detail,setDetail]=useState(null);useEffect(()=>{const controller=new AbortController();fetch('/api/v1/disks/'+encodeURIComponent(id),{signal:controller.signal}).then(response=>{if(!response.ok)throw new Error('disk-detail');return response.json() as Promise}).then(data=>{setDetail(data);setState('ready')}).catch(error=>{if(error instanceof DOMException&&error.name==='AbortError')return;setState('error')});return()=>controller.abort()},[id]);if(state==='loading')return
    ;if(state==='error'||!detail)return

    {copy.disks.errorTitle}

    {copy.disks.errorDetail}

    {copy.disks.back}
    ;const disk=detail.disk;return <>

    {copy.disks.detailEyebrow}

    {disk.name}

    {copy.disks.detailIntro}

    {copy.disks.source}

    {detail.source?.id||copy.disks.unknown}

    {detail.source?.reason||copy.disks.readOnly}

    {copy.disks.observed}: {date(detail.source?.observedAt)} · {detail.source?.freshness=== 'fresh'?copy.disks.fresh:copy.disks.stale}

    {copy.disks.capacity}

    {disk.utilizationPercent.toLocaleString('nl-BE',{maximumFractionDigits:1})}%

    {bytes(disk.usedBytes)} {copy.disks.usedOf} {bytes(disk.sizeBytes)} · {bytes(disk.freeBytes)} {copy.disks.free}

    {copy.disks.identity}

    {presentArrayRole(disk.role)}

    {disk.model||copy.disks.noModel} · {disk.serialDisplay||copy.disks.noSerial}

    {disk.inodes&&

    {copy.disks.inodes}

    {disk.inodes.utilizationPercent.toLocaleString('nl-BE',{maximumFractionDigits:1})}%

    {disk.inodes.used} / {disk.inodes.total}

    }
    {copy.disks.technical}
    ID
    {disk.id}
    {copy.disks.filesystem}
    {disk.filesystem||copy.disks.noFilesystem}
    {copy.disks.capacity}
    {bytes(disk.sizeBytes)}
    {copy.disks.free}
    {bytes(disk.freeBytes)}
    {copy.disks.serial}
    {disk.serialDisplay||copy.disks.noSerial}
    } diff --git a/apps/web/src/EventsPage.tsx b/apps/web/src/EventsPage.tsx new file mode 100644 index 0000000..01d1e47 --- /dev/null +++ b/apps/web/src/EventsPage.tsx @@ -0,0 +1,110 @@ +import { useDeferredValue, useEffect, useMemo, useRef, useState } from 'react'; + +import { copy } from './copy'; +import { formatDateTime, hasReceivedTimestamp } from './locale'; +import { queryValue, replaceListQuery } from './listQuery'; +import { presentEventSummary, presentEventType, presentStatus } from './presentation'; + +type EventItem = { id: string; type: string; severity: string; entityId?: string; sourceId?: string; occurredAt: string; receivedAt: string; summary: string }; +type EventResponse = { items?: EventItem[] }; +type LoadState = 'loading' | 'ready' | 'error'; + +const pageSize = 20; +const severities = ['critical', 'warning', 'attention', 'info', 'unknown'] as const; + +function severityTone(value: string): 'ready' | 'attention' | 'critical' | 'unknown' { + if (value === 'critical') return 'critical'; + if (value === 'warning' || value === 'attention' || value === 'error') return 'attention'; + if (value === 'info') return 'ready'; + return 'unknown'; +} + +function initialPage(): number { + const value = Number.parseInt(queryValue('page'), 10); + return Number.isFinite(value) && value > 1 ? value - 1 : 0; +} + +function searchableText(item: EventItem): string { + return [item.summary, presentEventSummary(item.type, item.summary), item.type, presentEventType(item.type), item.entityId, item.sourceId] + .filter(Boolean) + .join(' ') + .toLocaleLowerCase('nl-BE'); +} + +export function EventsPage() { + const [state, setState] = useState('loading'); + const [items, setItems] = useState([]); + const [search, setSearch] = useState(() => queryValue('q')); + const deferredSearch = useDeferredValue(search); + const [severity, setSeverity] = useState(() => queryValue('severity', severities)); + const [type, setType] = useState(() => queryValue('type')); + const [entity, setEntity] = useState(() => queryValue('entity')); + const [page, setPage] = useState(initialPage); + const [revision, setRevision] = useState(0); + const pageStatus = useRef(null); + + useEffect(() => { + const controller = new AbortController(); + setState('loading'); + fetch('/api/v1/events?limit=100', { signal: controller.signal }) + .then((response) => { if (!response.ok) throw new Error('events'); return response.json() as Promise; }) + .then((value) => { setItems((value.items ?? []).slice(0, 100)); setState('ready'); }) + .catch((error: unknown) => { if (!(error instanceof DOMException && error.name === 'AbortError')) setState('error'); }); + return () => controller.abort(); + }, [revision]); + + const types = useMemo(() => [...new Set(items.map((item) => item.type))].sort((a, b) => presentEventType(a).localeCompare(presentEventType(b), 'nl-BE')), [items]); + const entities = useMemo(() => [...new Set(items.map((item) => item.entityId).filter((value): value is string => Boolean(value)))].sort((a, b) => a.localeCompare(b)), [items]); + const normalizedSearch = deferredSearch.trim().toLocaleLowerCase('nl-BE'); + const shown = useMemo(() => items.filter((item) => (!severity || item.severity === severity) + && (!type || item.type === type) + && (!entity || item.entityId === entity) + && (!normalizedSearch || searchableText(item).includes(normalizedSearch))), [entity, items, normalizedSearch, severity, type]); + const criticalCount = items.filter((item) => item.severity === 'critical').length; + const pageCount = Math.max(1, Math.ceil(shown.length / pageSize)); + const currentPage = Math.min(page, pageCount - 1); + const pageItems = shown.slice(currentPage * pageSize, (currentPage + 1) * pageSize); + const firstResult = shown.length === 0 ? 0 : currentPage * pageSize + 1; + const lastResult = Math.min((currentPage + 1) * pageSize, shown.length); + + useEffect(() => { + if (page !== currentPage) setPage(currentPage); + }, [currentPage, page]); + useEffect(() => { + replaceListQuery({ q: search.trim(), severity, type, entity, page: currentPage > 0 ? String(currentPage + 1) : '' }); + }, [currentPage, entity, search, severity, type]); + + const resetPage = () => setPage(0); + const movePage = (next: number) => { + setPage(next); + requestAnimationFrame(() => pageStatus.current?.focus()); + }; + const clearFilters = () => { setSearch(''); setSeverity(''); setType(''); setEntity(''); setPage(0); }; + + return <> +

    {copy.events.eyebrow}

    {copy.events.title}

    {copy.events.intro}

    +
    +

    {copy.events.loaded}

    {items.length}

    {copy.events.loadedDetail}

    + +

    {copy.events.results}

    {shown.length}

    {firstResult}–{lastResult} {copy.events.of} {shown.length}

    +
    +
    +

    {copy.events.timeline}

    {copy.events.latest}

    +
    event.preventDefault()}> + + + + + +
    + {state === 'loading' ?

    {copy.events.loading}

    : state === 'error' ?

    {copy.events.errorTitle}

    {copy.events.errorDetail}

    : shown.length === 0 ?

    {copy.events.empty}

    :
      {pageItems.map((item) =>
    1. + {presentStatus(item.severity)} +

      {presentEventType(item.type)}

      {hasReceivedTimestamp(item.occurredAt) ? : {formatDateTime(item.occurredAt)}}

      {presentEventSummary(item.type, item.summary)}

      {item.entityId ? `${copy.events.entity}: ${item.entityId}` : copy.events.noEntity} +
      {copy.events.technical}
      ID
      {item.id}
      {copy.events.type}
      {item.type}
      {copy.events.source}
      {item.sourceId || copy.events.noSource}
      {copy.events.entity}
      {item.entityId || copy.events.noEntity}
      {copy.events.received}
      {formatDateTime(item.receivedAt)}
      +
      +
    2. )}
    } + {state === 'ready' && shown.length > 0 && } +

    {items.length} {copy.events.rows}

    +
    + ; +} diff --git a/apps/web/src/HostPage.tsx b/apps/web/src/HostPage.tsx new file mode 100644 index 0000000..a1e03dc --- /dev/null +++ b/apps/web/src/HostPage.tsx @@ -0,0 +1,90 @@ +import { formatDateTime } from './locale'; +import { useEffect, useState } from 'react'; +import { copy } from './copy'; +import { presentReason, presentStatus } from './presentation'; +import { SourceStatusDetails } from './SourceStatusDetails'; + +type HostSnapshot = { + source: { id: string; type: string; observedAt?: string; freshness: string; state: string; reason?: string }; + identity: { name: string; version?: string; kernel?: string; architecture?: string }; + uptimeSeconds: number; + bootTime?: string; + cpu: { totalPercent?: number; perCore?: number[]; iowaitPercent?: number }; + load: { one: number; five: number; fifteen: number }; + memory: { totalBytes: number; availableBytes: number; usedBytes: number; utilizationPercent: number; swapTotalBytes: number; swapUsedBytes: number; swapUtilizationPercent: number }; + filesystems: Array<{ mount: string; filesystem?: string; capacityBytes: number; usedBytes: number; utilizationPercent: number; inodes?: { total: number; used: number } }>; + network: Array<{ name: string; state?: string; rxBytes: number; txBytes: number; rxErrors: number; txErrors: number; rxDrops: number; txDrops: number }>; + time: { synchronized: boolean; offsetSeconds: number; stratum?: number; state: string }; + hardware?: { capabilities: Array<{ id: string; version: string; state: string; reason?: string }>; temperatures: Array<{ id: string; name: string; celsius: number }>; fans: Array<{ id: string; name: string; rpm: number }>; gpus: Array<{ id: string; name: string; vendor?: string; utilizationPercent?: number; memoryUsedBytes: number; memoryTotalBytes: number; memoryUtilizationPercent?: number; temperatureCelsius?: number }>; status: { state: string; reasons?: Array<{ code: string; message: string }> } }; + status: { state: string; reasons?: Array<{ code: string; message: string }> }; + observedAt?: string; + receivedAt: string; + warnings?: string[]; +}; + +function getStatusLabel(state: string): string { + return state === 'healthy' ? 'Gezond' : state === 'degraded' ? 'Aandacht' : 'Onbekend'; +} +function Badge({ state }: { state: string }) { + const ready = state === 'healthy'; + return {getStatusLabel(state)}; +} +function bytes(value: number): string { + if (!Number.isFinite(value) || value < 0) return '—'; + const units = ['B', 'KB', 'MB', 'GB', 'TB']; + let scaled = value; + let index = 0; + while (scaled >= 1024 && index < units.length - 1) { scaled /= 1024; index += 1; } + return scaled.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + ' ' + units[index]; +} +function duration(seconds: number): string { + if (!Number.isFinite(seconds) || seconds < 0) return '—'; + const days = Math.floor(seconds / 86400); + const hours = Math.floor((seconds % 86400) / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + return days > 0 ? days + ' d ' + hours + ' u' : hours + ' u ' + minutes + ' min'; +} +function when(value?: string): string { return formatDateTime(value); } + +export function HostPage() { + const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading'); + const [snapshot, setSnapshot] = useState(null); + useEffect(() => { + const controller = new AbortController(); + fetch('/api/v1/host', { signal: controller.signal }).then((response) => { + if (!response.ok) throw new Error('host'); + return response.json() as Promise; + }).then((data) => { setSnapshot(data); setState('ready'); }).catch((error: unknown) => { + if (error instanceof DOMException && error.name === 'AbortError') return; + setState('error'); + }); + return () => controller.abort(); + }, []); + if (state === 'loading') return
    ; + if (state === 'error' || !snapshot) return

    {copy.host.errorTitle}

    {copy.host.errorDetail}

    ; + const status = snapshot.status?.state ?? 'unknown'; + const observed = snapshot.observedAt ?? snapshot.source?.observedAt; + return <> +

    {copy.host.eyebrow}

    {copy.host.title}

    {copy.host.intro}

    +
    +

    {copy.host.identity}

    {snapshot.identity?.name || copy.host.unknown}

    {[snapshot.identity?.version, snapshot.identity?.kernel, snapshot.identity?.architecture].filter(Boolean).join(' · ') || copy.host.noIdentityDetails}

    + + {snapshot.status?.reasons?.map((reason) =>

    {presentReason(reason.code)}

    )} +
    +
    +

    {copy.host.uptime}

    {duration(snapshot.uptimeSeconds)}

    {snapshot.bootTime ? copy.host.boot + ' ' + when(snapshot.bootTime) : copy.host.noBoot}

    +

    {copy.host.cpu}

    {snapshot.cpu?.totalPercent == null ? '—' : snapshot.cpu.totalPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%'}

    {snapshot.cpu?.perCore?.length ?? 0} {copy.host.cores} · iowait {snapshot.cpu?.iowaitPercent == null ? '—' : snapshot.cpu.iowaitPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%'}

    +

    {copy.host.load}

    {snapshot.load?.one?.toLocaleString('nl-BE', { maximumFractionDigits: 2 }) ?? '—'}

    1 / 5 / 15 min: {snapshot.load?.one ?? '—'} · {snapshot.load?.five ?? '—'} · {snapshot.load?.fifteen ?? '—'}

    +

    {copy.host.memory}

    {snapshot.memory?.utilizationPercent?.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) ?? '—'}%

    {bytes(snapshot.memory?.usedBytes ?? 0)} / {bytes(snapshot.memory?.totalBytes ?? 0)} · {copy.host.available}: {bytes(snapshot.memory?.availableBytes ?? 0)}

    +

    {copy.host.time}

    {snapshot.time?.synchronized ? copy.host.synchronized : copy.host.notSynchronized}

    Offset {snapshot.time?.offsetSeconds?.toLocaleString('nl-BE', { maximumFractionDigits: 3 }) ?? '—'} s · stratum {snapshot.time?.stratum ?? '—'}

    +
    +
    +

    {copy.host.filesystems}

    {snapshot.filesystems?.length ?? 0}

    {snapshot.filesystems?.length ?
    {snapshot.filesystems.map((item) => )}
    {copy.host.mount}{copy.host.used}{copy.host.inodes}
    {item.mount}{item.utilizationPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 })}%{bytes(item.usedBytes)} / {bytes(item.capacityBytes)}{item.inodes ? ((item.inodes.used / item.inodes.total) * 100).toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%' : '—'}
    :

    {copy.host.noData}

    }
    +

    {copy.host.network}

    {snapshot.network?.length ?? 0}

    {snapshot.network?.length ?
    {snapshot.network.map((item) => )}
    {copy.host.interface}RX / TX{copy.host.errors}
    {item.name}{item.state || copy.host.unknown}{bytes(item.rxBytes)} / {bytes(item.txBytes)}{item.rxErrors + item.txErrors + item.rxDrops + item.txDrops}
    :

    {copy.host.noData}

    }
    +
    +
    +

    {copy.host.hardware}

    {snapshot.hardware?.temperatures?.length ?? 0} · {snapshot.hardware?.fans?.length ?? 0} {copy.host.sensors}

    {snapshot.hardware?.status?.reasons?.map((reason) =>

    {presentReason(reason.code)}

    )}{snapshot.hardware?.capabilities?.length ?
      {snapshot.hardware.capabilities.map((capability) =>
    • {capability.id}{presentStatus(capability.state)} · {presentReason(capability.reason)}
    • )}
    : null}{snapshot.hardware?.temperatures?.length ?
    {snapshot.hardware.temperatures.map((item) => )}
    {copy.host.sensor}{copy.host.temperature}
    {item.name}{item.id}{item.celsius.toLocaleString('nl-BE', { maximumFractionDigits: 1 })} °C
    :

    {copy.host.noSensors}

    }
    +

    {copy.host.gpu}

    {snapshot.hardware?.gpus?.length ?? 0}

    {snapshot.hardware?.gpus?.length ?
    {snapshot.hardware.gpus.map((item) => )}
    {copy.host.device}{copy.host.gpuUsage}{copy.host.gpuMemory}
    {item.name}{item.vendor || copy.host.unknown}{item.utilizationPercent == null ? '—' : item.utilizationPercent.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%'}{item.memoryTotalBytes ? item.memoryUtilizationPercent?.toLocaleString('nl-BE', { maximumFractionDigits: 1 }) + '%' : '—'}
    :

    {copy.host.noGpu}

    }
    +
    {snapshot.warnings?.length ?

    {copy.host.warnings}

    {snapshot.warnings.map((warning) =>

    {presentReason(warning)}

    )}
    : null} + ; +} diff --git a/apps/web/src/IncidentPage.tsx b/apps/web/src/IncidentPage.tsx new file mode 100644 index 0000000..84e66e7 --- /dev/null +++ b/apps/web/src/IncidentPage.tsx @@ -0,0 +1,46 @@ +import { useEffect, useMemo, useState } from 'react'; +import { copy } from './copy'; +import { formatDateTime } from './locale'; + +type Association = { alertId: string; rationale: string; confidence: number; correlationMethod: string; manual: boolean; addedBy?: string; createdAt: string }; +type Note = { id: string; incidentId: string; author: string; body: string; createdAt: string }; +type Incident = { id: string; correlationKey: string; title: string; summary: string; severity: string; status: string; startedAt: string; resolvedAt?: string; ownerUserId?: string; correlationMethod: string; confidence: number; revision: number; updatedAt: string; alerts?: Association[]; notes?: Note[] }; + +function navigate(path: string) { window.history.pushState({}, '', path); window.dispatchEvent(new PopStateEvent('popstate')); } +function formatTime(value: string) { return formatDateTime(value); } +function severityLabel(value: string) { return value === 'critical' ? 'Kritiek' : value === 'degraded' ? 'Aandacht' : 'Opmerking'; } +function statusLabel(value: string) { return value === 'resolved' ? 'Opgelost' : value === 'acknowledged' ? 'Erkend' : 'Open'; } + +export function IncidentPage({ id }: { id?: string }) { + const [state, setState] = useState<'loading' | 'ready' | 'empty' | 'error' | 'unauthorized'>('loading'); + const [items, setItems] = useState([]); + const [incident, setIncident] = useState(null); + const [note, setNote] = useState(''); + const [owner, setOwner] = useState(''); + const [message, setMessage] = useState(''); + const [reload, setReload] = useState(0); + useEffect(() => { + const controller = new AbortController(); + setState('loading'); + const url = id ? '/api/v1/incidents/' + encodeURIComponent(id) : '/api/v1/incidents?limit=100&status=open'; + fetch(url, { signal: controller.signal }).then((response) => { if (response.status === 401) throw new Error('unauthorized'); if (!response.ok) throw new Error('error'); return response.json() as Promise<{ incident?: Incident; items?: Incident[] }>; }).then((data) => { + if (id) { const next = data.incident ?? null; setIncident(next); setOwner(next?.ownerUserId ?? ''); setState(next ? 'ready' : 'empty'); } else { const next = data.items ?? []; setItems(next); setState(next.length ? 'ready' : 'empty'); } + }).catch((error: unknown) => { if (error instanceof DOMException && error.name === 'AbortError') return; setState(error instanceof Error && error.message === 'unauthorized' ? 'unauthorized' : 'error'); }); + return () => controller.abort(); + }, [id, reload]); + const timeline = useMemo(() => { + if (!incident) return [] as Array<{ id: string; label: string; detail: string; at: string }>; + const entries = (incident.alerts ?? []).map((alert) => ({ id: 'alert-' + alert.alertId, label: alert.manual ? 'Handmatig gekoppeld alert' : 'Gecorreleerd alert', detail: alert.rationale + ' · confidence ' + Math.round(alert.confidence * 100) + '%', at: alert.createdAt })); + entries.push(...(incident.notes ?? []).map((item) => ({ id: item.id, label: 'Notitie van ' + item.author, detail: item.body, at: item.createdAt }))); + return entries.sort((a, b) => a.at.localeCompare(b.at) || a.id.localeCompare(b.id)); + }, [incident]); + const submitNote = async () => { if (!id || !note.trim()) return; setMessage('Notitie wordt opgeslagen…'); const response = await fetch('/api/v1/incidents/' + encodeURIComponent(id) + '/notes', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ body: note }) }); if (!response.ok) { setMessage('De notitie kon niet worden opgeslagen.'); return; } setNote(''); setMessage('Notitie opgeslagen.'); setReload((value) => value + 1); }; + const saveOwner = async () => { if (!id || !incident) return; setMessage('Eigenaar wordt opgeslagen…'); const response = await fetch('/api/v1/incidents/' + encodeURIComponent(id), { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ownerUserId: owner.trim(), revision: incident.revision }) }); if (!response.ok) { setMessage('De eigenaar kon niet worden opgeslagen.'); return; } setMessage('Eigenaar opgeslagen.'); setReload((value) => value + 1); }; + if (state === 'loading') return
    ; + if (state === 'unauthorized') return

    Geen toegang tot incidenten

    Je hebt geen rechten om incidentgegevens te bekijken.

    ; + if (state === 'error') return

    Incidenten niet beschikbaar

    De incidentgegevens konden niet veilig worden geladen.

    ; + if (!id && state === 'empty') return <>

    {copy.incidents.listEyebrow}

    {copy.incidents.listEyebrow}

    {copy.incidents.listIntro}

    Geen open incidenten

    Er zijn momenteel geen open incidenten geregistreerd.

    ; + if (!id) return <>

    {copy.incidents.listEyebrow}

    {copy.incidents.listEyebrow}

    {copy.incidents.listIntro}

    {copy.incidents.openIncidents}

    {copy.incidents.listTitle}

    {items.length} incidenten
      {items.map((item) =>
    • )}
    ; + if (!incident) return null; + return <>

    {copy.incidents.detailEyebrow}

    {incident.title}

    {incident.summary}

    Ernst{severityLabel(incident.severity)}Status{statusLabel(incident.status)}{copy.incidents.started}{formatTime(incident.startedAt)}{copy.incidents.confidence}{Math.round(incident.confidence * 100)}%

    {copy.incidents.statusAndConfidence}

    {statusLabel(incident.status)}

    {severityLabel(incident.severity)}
    {copy.incidents.started}
    {formatTime(incident.startedAt)}
    {copy.incidents.correlationMethod}
    {incident.correlationMethod}
    {copy.incidents.confidence}
    {Math.round(incident.confidence * 100)}%
    {copy.incidents.revision}
    {incident.revision}

    Correlatie is een onderbouwde aanwijzing, geen bewezen causaliteit. Betrouwbaarheid beschrijft de correlatieregel, niet de zekerheid van de oorzaak.

    {copy.incidents.ownership}

    {copy.incidents.followUp}

    {copy.incidents.ownerNote}

    {copy.incidents.timeline}

    {copy.incidents.signalsAndNotes}

    {timeline.length} {copy.incidents.timelineItems}
    {timeline.length === 0 ?

    {copy.incidents.noTimeline}

    :
      {timeline.map((entry) =>
    1. {entry.label}

      {entry.detail}

    2. )}
    }

    {copy.incidents.notes}

    {copy.incidents.operatorContext}