Mission Control demo v2
Polished command-center for FlowMaster with two data modes:
- SNAPSHOT: bundled src/scenarios.json from demo.flow-master.ai
- LIVE: in-browser fetch via src/lib/api.ts (dev-login + bearer)
Scenarios:
- procurement, extra-1, extra-2 (live from EA2)
- ar, hcm, gl, service (industry blueprints, same typed shell)
Honesty pass after Oracle review:
- No invented numbers (Telemetry derives SLA + agent acceptance from real data)
- Preview-only actions fire toasts naming the endpoint to wire them
- Blueprint tours framed as 'industry blueprint', not 'we don't have this yet'
- Mode pill + last-fetch age + refresh in topbar
- Dev CORS dodged via vite proxy; production deploys same-origin
18 vitest tests + 26 playwright smoke assertions + DOM layout audit.
Constraint: cross-origin live mode rejected by browser → fall back to snapshot
Rejected: hardcoded SLA % | dishonest demo metrics
Directive: wire preview-only action handlers to /api/runtime/transactions/{id}/actions to ship them for real
Confidence: high
Scope-risk: narrow
Not-tested: production deployment via flowmaster-ops overlay
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { syntheticScenarios } from "./synthetic";
|
||||
|
||||
describe("syntheticScenarios", () => {
|
||||
it("has exactly 4 families: ar, hcm, gl, service", () => {
|
||||
expect(syntheticScenarios.map((s) => s.id).sort()).toEqual(["ar", "gl", "hcm", "service"]);
|
||||
});
|
||||
|
||||
it("each scenario is marked live=false and has a representative running step", () => {
|
||||
for (const s of syntheticScenarios) {
|
||||
expect(s.live).toBe(false);
|
||||
expect(s.steps.some((st) => st.state === "running")).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("edges only reference existing step ids", () => {
|
||||
for (const s of syntheticScenarios) {
|
||||
const ids = new Set(s.steps.map((st) => st.id));
|
||||
for (const e of s.edges) {
|
||||
expect(ids.has(e.source)).toBe(true);
|
||||
expect(ids.has(e.target)).toBe(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("queue items reference real step ids", () => {
|
||||
for (const s of syntheticScenarios) {
|
||||
const ids = new Set(s.steps.map((st) => st.id));
|
||||
for (const q of s.queue) expect(ids.has(q.stepId)).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user