PageSourceSearch

https://relyup.ca/assets/app.reports.compliance-Ca-TcNZF.js

js relyup.ca collected 2026-10-09 22:56:00 UTC 16,453 bytes, 22 lines download raw bytes

1import{j as e,L as C,aH as I,r as x,aI as M,aJ as P,aK as O,d as R}from"./index-CfcSdzPN.js";import{u as U}from"./useServerFn-DgcYVCxo.js";import{u as H}from"./useSuspenseQuery-DpmK42BQ.js";import{C as r,a as o,b as c,d as i}from"./card-RPvAsS7o.js";import{B as z}from"./button-BIdGwjim.js";import{B as h}from"./badge-CjS4Q0u4.js";import{T,a as L,b as f,c as n,d as _,e as l}from"./table-RAwcwa9b.js";import{T as V,a as q,b as W,c as $}from"./tooltip-BkwBKjAv.js";import{L as G}from"./level-badge-CELmUPE5.js";import{L as K}from"./letterhead-CX6onCuX.js";import{e as X}from"./export-branded-pdf-BlThUyOa.js";import{u as J}from"./use-org-asset-type-Ch79OKBx.js";import{T as Q,a as m}from"./turbo-metrics-DDyXyVyb.js";import{A as k}from"./arrow-left-6iPj3emP.js";import{S as p}from"./shield-check-B6XlA_cA.js";import{F as Y}from"./file-text-B5Zk-iPY.js";import{I as Z}from"./info-BDRKLfos.js";import"./useQuery-DDNSg42L.js";import"./utils-DDt1maD9.js";import"./index-CertmylC.js";import"./index-Bfj6Pq9H.js";import"./index-CIF9E9WT.js";import"./index-CDH9WtiJ.js";import"./index-MClwAS4I.js";import"./index-Byyfr87I.js";import"./index-Cm3yy5FH.js";import"./index-di4K2cQF.js";import"./index-C-JUTNGR.js";import"./index-DWmh5UbG.js";import"./relyup-lockup-clean-horizontal-light.png.asset-DLak0MwK.js";import"./turbo-sync.functions-D1aD1v78.js";import"./org-switcher-provider-DoMbZ9EO.js";const ee=6e4;function d({text:t,children:u}){return e.jsx(V,{delayDuration:150,children:e.jsxs(q,{children:[e.jsx(W,{asChild:!0,children:e.jsxs("span",{className:"inline-flex items-center gap-1 cursor-help",children:[u,e.jsx(Z,{className:"h-3 w-3 text-muted-foreground"})]})}),e.jsx($,{className:"max-w-xs text-xs",children:t})]})})}function j(t){return t?new Date(t).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}):"—"}function se(t){return new Date(t).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}function te(t){return t==null?"VID-—":`VID-${String(t).padStart(5,"0")}`}const ae=[{level:"L0",n:"0",desc:"Healthy / no flag"},{level:"L1",n:"≥ 1",desc:"Watch (most sensitive, broadest coverage)"},{level:"L2",n:"≥ 2",desc:"Monitor"},{level:"L3",n:"≥ 3",desc:"Warning — alarm triggered"},{level:"L4",n:"≥ 4",desc:"Severe — high confidence"},{level:"L5",n:"= 5",desc:"Critical — all 5 models agree"}];function Oe(){const{isTurbo:t}=J();return t?e.jsx(ie,{}):e.jsx(re,{})}function re(){const t=U(I),u=x.useMemo(()=>M({queryKey:O,queryFn:()=>t(),staleTime:P,refetchInterval:ee,refetchOnWindowFocus:!0}),[t]),{data:a}=H(u),[g,A]=x.useState("all"),[v,B]=x.useState("all"),b=x.useRef(null),[N,y]=x.useState(!1),w=a.alarm_events.filter(s=>!(g!=="all"&&s.action!==g||v!=="all"&&s.level!==Number(v)));async function D(){if(!b.current)return;const s=new Date().toISOString().slice(0,10).replace(/-/g,""),F=(a.organization_name??"my-fleet").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");y(!0);try{await X(b.current,`compliance-audit-${F}-${s}.pdf`)}finally{y(!1)}}const S=a.cycles??[],E=a.validation?.is_bit_exact===!0;return e.jsx(K,{className:"compliance-letterhead",children:e.jsxs("div",{ref:b,className:"space-y-6 compliance-print",children:[e.jsx("style",{children:`
2        @media print {
3          body.compliance-printing aside,
4          body.compliance-printing nav,
5          body.compliance-printing header[data-app-header],
6          body.compliance-printing [data-no-print] {
7            display: none !important;
8          }
9          body.compliance-printing {
10            background: white !important;
11            color: black !important;
12          }
13          body.compliance-printing .compliance-print {
14            padding: 0 !important;
15          }
16          body.compliance-printing .compliance-print .card,
17          body.compliance-printing .compliance-print [class*="rounded-xl"] {
18            break-inside: avoid;
19            page-break-inside: avoid;
20          }
21        }
22      `}),e.jsx("div",{"data-no-print":!0,children:e.jsxs(C,{to:"/app/reports",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(k,{className:"h-4 w-4"})," Back to reports"]})}),e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-bold",children:"Compliance audit trail"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Traceability of model decisions, validation status, and operational events. Designed for technical audit and regulatory review."}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[a.organization_name??"My fleet"," · generated ",j(a.generated_at)]})]}),e.jsxs(z,{size:"sm",variant:"outline",onClick:D,disabled:N,"data-no-print":!0,children:[N?e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Y,{className:"h-3.5 w-3.5"})," Export PDF"]})]}),e.jsx(r,{children:e.jsx(i,{className:"p-4 text-sm text-muted-foreground",children:"This report provides documented evidence of model version control, validation rigor, decision thresholds, and operational event history. Use as supp
22orting material for external audit, fleet insurance review, or partnership due diligence."})}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsxs(c,{className:"flex items-center gap-2 text-lg",children:[e.jsx(p,{className:"h-4 w-4"})," Model version"]})}),e.jsxs(i,{className:"grid grid-cols-1 gap-3 text-sm md:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border py-2",children:[e.jsx(d,{text:"Released ensemble version, tagged in the Mytruck backend. All inference runs in this report use this build.",children:e.jsx("span",{className:"text-muted-foreground",children:"Model version"})}),e.jsx("span",{className:"font-mono",children:a.model.version})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border py-2",children:[e.jsx(d,{text:"Date the model artifacts were frozen and packaged for deployment.",children:e.jsx("span",{className:"text-muted-foreground",children:"Build date"})}),e.jsx("span",{className:"font-mono",children:a.model.build_date})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border py-2",children:[e.jsx(d,{text:"Bit-exact validation compares live predictions against canonical baseline outputs. Pass when max_diff stays below 0.0005.",children:e.jsx("span",{className:"text-muted-foreground",children:"Validation status"})}),E?e.jsx(h,{className:"bg-emerald-600 text-white hover:bg-emerald-600/90",children:"Bit-exact validated (max_diff 0.0002)"}):e.jsx(h,{variant:"secondary",children:"Validation pending"})]}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border py-2",children:[e.jsx(d,{text:"Source-code revision the artifacts were built from. Populated once a release manifest is wired to the worker.",children:e.jsx("span",{className:"text-muted-foreground",children:"Code freeze hash"})}),e.jsx("span",{className:"font-mono text-xs",children:a.model.code_freeze_hash??"—"})]})]})]}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsx(c,{className:"text-lg",children:"Dataset breakdown"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Total vehicles"}),e.jsx("div",{className:"font-display text-2xl font-bold",children:a.dataset.total.toLocaleString("en-US")})]}),e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Faulty (confirmed failure)"}),e.jsx("div",{className:"font-display text-2xl font-bold",children:a.dataset.faulty.toLocaleString("en-US")})]}),e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Healthy"}),e.jsx("div",{className:"font-display text-2xl font-bold",children:a.dataset.healthy.toLocaleString("en-US")})]})]}),e.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-foreground",children:"Source:"})," Internal validation dataset, anonymized commercial heavy-vehicle telemetry."]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-foreground",children:"Data window:"})," Full operational lifecycle until canonical failure event for faulty vehicles."]})]})]})]}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsx(c,{className:"text-lg",children:"Threshold rules"})}),e.jsxs(i,{className:"space-y-3 p-6 pt-0",children:[e.jsxs(T,{children:[e.jsx(L,{children:e.jsxs(f,{children:[e.jsx(n,{children:"Level"}),e.jsx(n,{children:e.jsx(d,{text:"n_agree = number of models (out of 5: BCE, MIL, SeqTransformer, PatchTST, XGBoost) that classify the vehicle as faulty in a given prediction window.",children:"n_agree threshold"})}),e.jsx(n,{children:"Description"})]})}),e.jsx(_,{children:ae.map(s=>e.jsxs(f,{children:[e.jsx(l,{children:e.jsx(G,{level:Number(s.level.slice(1))})}),e.jsx(l,{className:"font-mono text-xs",children:s.n}),e.jsx(l,{className:"text-sm",children:s.desc})]},s.level))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Thresholds are fixed by design (not learned) and consistent across all deployments. Documented in the internal model specification."})]})]}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsx(c,{className:"text-lg",children:"Worker cycles history"})}),e.jsx(i,{className:"p-0",children:S.length===0?e.jsxs("div",{className:"p-6 text-sm text-muted-foreground",children:["No completed cycles yet in this session.",a.worker?.started_at&&e.jsxs(e.Fragment,{children:[" Worker started at ",j(a.worker.started_at),"."]})]}):e.jsxs(T,{children:[e.jsx(L,{children:e.jsxs(f,{children:[e.jsx(n,{children:"Cycle ID"}),e.jsx(n,{children:"Started at"}),e.jsx(n,{children:"Completed at"}),e.jsx(n,{children:"Vids processed"}),e.jsx(n,{children:"Status"})]})}),e.jsx(_,{children:S.slice(0,10).map(s=>e.jsxs(f,{children:[e.jsxs(l,{className:"font-mono text-xs",children:["#",s.cycle_id]}),e.jsx(l,{className:"font-mono text-xs",children:j(s.started_at)}),e.jsx(l,{className:"font-mono text-xs",children:s.finished_at?j(s.finished_at):"—"}),e.jsx(l,{className:"font-mono text-xs",children:s.vehicles_processed}),e.jsx(l,{children:s.finished_at?e.jsx(h,{variant:"secondary",children:"completed"}):e.jsx(h,{children:"running"})})]},s.cycle_id))})]})})]}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(c,{className:"text-lg",children:"Alarm events timeline"}),e.jsxs("div",{className:"flex gap-2 text-xs","data-no-print":!0,children:[e.jsxs("select",{value:g,onChange:s=>A(s.target.value),className:"rounded-md border border-border bg-background px-2 py-1",children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("option",{value:"created",children:"Created"}),e.jsx("option",{value:"resolved",children:"Resolved"})]}
22),e.jsxs("select",{value:v,onChange:s=>B(s.target.value),className:"rounded-md border border-border bg-background px-2 py-1",children:[e.jsx("option",{value:"all",children:"All levels"}),e.jsx("option",{value:"3",children:"L3"}),e.jsx("option",{value:"4",children:"L4"}),e.jsx("option",{value:"5",children:"L5"})]})]})]})}),e.jsx(i,{children:w.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:a.alarm_events.length===0?"No alarm events in current session.":"No events match the selected filters."}):e.jsx("ul",{className:"space-y-1.5 font-mono text-xs",children:w.map(s=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:se(s.ts)}),e.jsxs("span",{children:["— ",te(s.vid)," — ",s.action," (L",s.level,", ",s.prev_status," →"," ",s.new_status,")"]})]},`${s.id}-${s.action}`))})})]}),e.jsxs(r,{children:[e.jsx(o,{children:e.jsx(c,{className:"text-lg",children:"Standards alignment"})}),e.jsx(i,{children:e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(p,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsx(d,{text:"Methodological alignment with ISO 26262 (functional safety for road vehicles). Formal certification requires external audit and is outside the scope of this report.",children:e.jsx("span",{children:"ISO 26262 framework aligned"})})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(p,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsx(d,{text:"Industry 4.0 reference architecture (RAMI 4.0) with AAS-based digital twin for asset metadata, lifecycle, and predictive models. Compatible with Eclipse BaSyx and OPC UA stacks.",children:e.jsx("span",{children:"RAMI 4.0 / Asset Administration Shell (AAS) compliant"})})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(p,{className:"mt-0.5 h-4 w-4 text-muted-foreground"}),e.jsx(d,{text:"Original architecture combining 5 complementary ML models (BCE, MIL, SeqTransformer, PatchTST, XGBoost) with hierarchical agreement levels. Validated bit-exact on a dataset of 5,172 commercial heavy-vehicle telemetry records.",children:e.jsx("span",{children:"Multi-pipeline ensemble with hierarchical L0–L5 classification"})})]})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This compliance audit trail provides documented traceability of model versioning, validation status, decision thresholds, and operational events. Formal certifications (ISO 26262, UNECE WP.29, fleet insurance audits) require independent external assessment and are outside the scope of this report. All assumptions and standards alignments listed here represent the methodological framework adopted by RelyUp; they do not constitute certifications by any regulatory body."}),e.jsx("p",{className:"text-center text-xs text-muted-foreground print:block",children:"Generated by RelyUp — Audit Document"})]})})}function ie(){const t=m.dataset;return e.jsxs("div",{className:"space-y-6 p-1",children:[e.jsxs(C,{to:"/app/reports",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(k,{className:"h-4 w-4"})," Back to reports"]}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-bold",children:"Compliance"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[Q," · unsupervised model ",m.model_version]})]}),e.jsxs(r,{children:[e.jsx(o,{className:"pb-2",children:e.jsx(c,{className:"text-base",children:"Model card"})}),e.jsxs(i,{className:"grid gap-3 text-sm sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Version"}),e.jsx("div",{className:"font-mono",children:m.model_version})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Build date"}),e.jsx("div",{className:"font-mono",children:m.build_date})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Paradigm"}),e.jsx("div",{children:"Unsupervised (no failure labels)"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Validation"}),e.jsxs(h,{className:"gap-1 bg-emerald-600 text-white hover:bg-emerald-600/90",children:[e.jsx(p,{className:"h-3.5 w-3.5"})," Bit-exact (max_diff ",m.bit_exact_max_diff.toFixed(4),")"]})]})]})]}),e.jsxs(r,{children:[e.jsx(o,{className:"pb-2",children:e.jsx(c,{className:"text-base",children:"Dataset"})}),e.jsxs(i,{className:"space-y-2 text-sm",children:[e.jsxs("p",{children:[t.total," monitored vehicles · ",t.modeled," modelled. No faulty/healthy 
22split (unsupervised); pseudo-events approximated by ",e.jsx("span",{className:"font-mono",children:m.resets.count})," resets across"," ",e.jsx("span",{className:"font-mono",children:m.resets.vehicles})," vehicles."]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Data window: full operational life-cycle per vehicle."})]})]})]})}export{Oe as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.