feat(demo): plain-language integration status, richer audit, reset integrity

Integration status badges across Dashboard/Automation now show honest
plain-language labels instead of raw backend state strings (and fix a
few states that had no matching CSS colour class at all). Audit trail
gets a "view related events" action reusing the existing correlation_id
filter. About page gains scope/architecture/security/testing sections
and a guided-demo entry point. POST /api/v1/demo/reset now runs and
records a server-side scenario-integrity check. Also fixes a second real
race condition (caught by the return-review e2e test): the odometer
scenario pre-fill now resolves before ReturnForm mounts instead of
patching its value in after the fact.
This commit is contained in:
NuklearRabbit
2026-08-03 15:00:11 +02:00
parent cf9a889547
commit 5fa4fe0811
13 changed files with 254 additions and 48 deletions
+4 -1
View File
@@ -14,7 +14,7 @@ from app.models.user import User
from app.schemas import CurrentUser, DemoLoginRequest, DemoManifestOut
from app.seed_loader import reset_and_seed
from app.services.audit import record_audit_event
from app.services.demo_manifest import build_demo_manifest
from app.services.demo_manifest import build_demo_manifest, scenario_integrity_report
router = APIRouter(prefix="/api/v1/demo", tags=["demo"])
settings = get_settings()
@@ -107,6 +107,7 @@ def demo_reset(
detail="Demo reset is disabled on this deployment.",
)
result = reset_and_seed(db)
integrity = scenario_integrity_report(db)
record_audit_event(
db,
actor_type="user",
@@ -116,6 +117,7 @@ def demo_reset(
metadata={
"counts": result.counts,
"anchor_date": result.anchor_date.isoformat(),
"scenario_integrity": integrity,
},
)
db.commit()
@@ -125,4 +127,5 @@ def demo_reset(
"counts": result.counts,
"anchor_date": result.anchor_date.isoformat(),
"seeded_at": result.seeded_at.isoformat(),
"scenario_integrity": integrity,
}