// Method8 — demo · shared operating-model data.
// Expectations, artefacts and the health measures, consumed by the Operating
// model overview (os.jsx) and the per-expectation pages (expectation.jsx).

// three measures that blend into model health
const MEASURES = [
  { name: 'Understanding', src: 'Formative · survey', value: 76, color: '#17b26a' },
  { name: 'Performance', src: 'Survey · gap assessment', value: 88, color: '#47cd89' },
  { name: 'Maturity', src: 'Gap assessment · formative', value: 29, color: '#f04438' },
];
const HEALTH = 49;

const ACCENTS = {
  vdo: { bar: '#2e90fa', tint: '#eff8ff' },
  gs: { bar: '#0ba5ec', tint: '#f0f9ff' },
  cp: { bar: '#17b26a', tint: '#f0fdf4' },
  tech: { bar: '#d444f1', tint: '#fdf4ff' },
  pmr: { bar: '#ef6820', tint: '#fff6ed' },
};

// artefact status: built | progress | assure | pending
const EXPECTATIONS = [
  { id: 'vdo', name: 'Value Delivery & Organisation', surveyHealth: 87, gapConf: 71,
    measures: { u: 90, p: 94, m: 71 },
    stmt: 'Our organisation / team operates with clearly defined and understood mandates, services, decisions, interfaces, and role accountabilities.',
    artefacts: [
      ['Mandate', 'built'], ['Services', 'built'], ['Critical Decisions', 'progress'], ['Interfaces', 'assure'],
      ['Roles and accountabilities', 'progress'], ['Position Descriptions', 'built'], ['Structure', 'built'],
    ],
    note: 'Internal alignment is strong; cross-functional interfaces with Operations are the weak point — a sitewide RACI is the next step.',
    assessedBy: [
      ['Operating Model Health Survey', 'survey', '87% agreement'],
      ['Standard Gap Assessment', 'gap', '71% conformance'],
      ['Interface Assessment', 'interface', 'Interfaces flagged'],
    ]},
  { id: 'gs', name: 'Governance & Standards', surveyHealth: 84, gapConf: 58,
    measures: { u: 86, p: 88, m: 58 },
    stmt: 'Our standards, material risks, and critical documentation are clearly defined, owned and applied.',
    artefacts: [
      ['Enterprise Standards', 'assure'], ['Critical Documentation', 'pending'], ['Materials Risks and Owners', 'progress'],
    ],
    note: 'Critical documentation has no governance — owners, controllers and change-control are not assigned. The lowest workshop score.',
    assessedBy: [
      ['Standard Gap Assessment', 'gap', '58% conformance'],
      ['AI Gap Assessment', 'gap-ai', '6 gaps drafted'],
      ['Operating Model Health Survey', 'survey', '84% agreement'],
    ]},
  { id: 'cp', name: 'Critical Processes', surveyHealth: 67, gapConf: 66,
    measures: { u: 72, p: 80, m: 66 },
    stmt: 'Our critical processes are clearly defined, owned and consistently executed to deliver our mandate.',
    artefacts: [
      ['Critical Processes and Owners', 'progress'], ['RACI', 'pending'],
    ],
    note: 'Process design exists but execution is inconsistent — the gap is between design and operation. No end-to-end owner.',
    assessedBy: [
      ['Standard Gap Assessment', 'gap', '66% conformance'],
      ['Health Assessment', 'workshop', '42% coordination'],
    ]},
  { id: 'tech', name: 'Technology', surveyHealth: 92, gapConf: 52,
    measures: { u: 92, p: 90, m: 52 },
    stmt: 'Our digital tools, applications and reporting are fit-for-purpose, clearly owned and support performance.',
    artefacts: [
      ['Applications', 'pending'], ['Digital Tools', 'pending'], ['Reporting', 'progress'],
    ],
    note: 'Biggest divergence: people can use the tools (92% survey) but the room agrees they are not fit-for-purpose. No single source of truth.',
    assessedBy: [
      ['Operating Model Health Survey', 'survey', '92% agreement'],
      ['Standard Gap Assessment', 'gap', '52% conformance'],
    ]},
  { id: 'pmr', name: 'Performance Management & Routines', surveyHealth: 64, gapConf: 64,
    measures: { u: 70, p: 78, m: 64 },
    stmt: 'We operate with clear performance metrics and disciplined routines that drive accountability and continuous improvement.',
    artefacts: [
      ['Metrics', 'pending'], ['Scorecards', 'progress'], ['Service Level Agreements', 'pending'], ['Meeting Routines', 'built'],
    ],
    note: 'Internal routines are reasonable, but there are no standardised metrics or SLAs holding accountability across the Ops interface.',
    assessedBy: [
      ['Operating Model Health Survey', 'survey', '64% agreement'],
      ['Standard Gap Assessment', 'gap', '64% conformance'],
    ]},
];

const EXP_BY_ID = Object.fromEntries(EXPECTATIONS.map((e) => [e.id, e]));

// derive each expectation's blended health from its three measures
EXPECTATIONS.forEach((e) => {
  if (e.measures) e.health = Math.round((e.measures.u + e.measures.p + e.measures.m) / 3);
});

Object.assign(window, { MODEL: { MEASURES, HEALTH, ACCENTS, EXPECTATIONS, EXP_BY_ID } });
