@tenhaw/ai-readiness 0.0.0-bootstrap → 0.0.0-stage

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js DELETED
@@ -1,1214 +0,0 @@
1
- // src/index.ts
2
- import { invariant, round, validateInput, renderReport, escapeHtml } from "@tenhaw/core";
3
-
4
- // src/framework.json
5
- var framework_default = {
6
- version: "v1",
7
- minimumBandCoverage: 0.8,
8
- dimensions: [
9
- {
10
- id: "strategy",
11
- label: "Strategy and value",
12
- weight: 0.2,
13
- questions: [
14
- {
15
- id: "strategy-1",
16
- text: "Is there an agreed business outcome for AI investment?",
17
- anchors: [
18
- {
19
- score: 1,
20
- label: "Not established",
21
- description: "No repeatable practice or supporting evidence is available."
22
- },
23
- {
24
- score: 2,
25
- label: "Ad hoc",
26
- description: "A few activities happen, with inconsistent ownership and limited evidence."
27
- },
28
- {
29
- score: 3,
30
- label: "Defined",
31
- description: "An agreed practice has an owner and is used for the intended scope."
32
- },
33
- {
34
- score: 4,
35
- label: "Measured",
36
- description: "The practice is consistently applied and reviewed using evidence."
37
- },
38
- {
39
- score: 5,
40
- label: "Improving",
41
- description: "Measured outcomes guide regular improvements and wider reuse."
42
- }
43
- ],
44
- recommendations: {
45
- low: "Agree an owner and gather evidence: Is there an agreed business outcome for AI investment?",
46
- medium: "Test consistent use and measure the outcome: Is there an agreed business outcome for AI investment?",
47
- high: "Review evidence and improve the practice: Is there an agreed business outcome for AI investment?"
48
- }
49
- },
50
- {
51
- id: "strategy-2",
52
- text: "Are use cases prioritised against measurable value?",
53
- anchors: [
54
- {
55
- score: 1,
56
- label: "Not established",
57
- description: "No repeatable practice or supporting evidence is available."
58
- },
59
- {
60
- score: 2,
61
- label: "Ad hoc",
62
- description: "A few activities happen, with inconsistent ownership and limited evidence."
63
- },
64
- {
65
- score: 3,
66
- label: "Defined",
67
- description: "An agreed practice has an owner and is used for the intended scope."
68
- },
69
- {
70
- score: 4,
71
- label: "Measured",
72
- description: "The practice is consistently applied and reviewed using evidence."
73
- },
74
- {
75
- score: 5,
76
- label: "Improving",
77
- description: "Measured outcomes guide regular improvements and wider reuse."
78
- }
79
- ],
80
- recommendations: {
81
- low: "Agree an owner and gather evidence: Are use cases prioritised against measurable value?",
82
- medium: "Test consistent use and measure the outcome: Are use cases prioritised against measurable value?",
83
- high: "Review evidence and improve the practice: Are use cases prioritised against measurable value?"
84
- }
85
- },
86
- {
87
- id: "strategy-3",
88
- text: "Does an accountable sponsor own the AI strategy?",
89
- anchors: [
90
- {
91
- score: 1,
92
- label: "Not established",
93
- description: "No repeatable practice or supporting evidence is available."
94
- },
95
- {
96
- score: 2,
97
- label: "Ad hoc",
98
- description: "A few activities happen, with inconsistent ownership and limited evidence."
99
- },
100
- {
101
- score: 3,
102
- label: "Defined",
103
- description: "An agreed practice has an owner and is used for the intended scope."
104
- },
105
- {
106
- score: 4,
107
- label: "Measured",
108
- description: "The practice is consistently applied and reviewed using evidence."
109
- },
110
- {
111
- score: 5,
112
- label: "Improving",
113
- description: "Measured outcomes guide regular improvements and wider reuse."
114
- }
115
- ],
116
- recommendations: {
117
- low: "Agree an owner and gather evidence: Does an accountable sponsor own the AI strategy?",
118
- medium: "Test consistent use and measure the outcome: Does an accountable sponsor own the AI strategy?",
119
- high: "Review evidence and improve the practice: Does an accountable sponsor own the AI strategy?"
120
- }
121
- },
122
- {
123
- id: "strategy-4",
124
- text: "Are investment assumptions reviewed using evidence?",
125
- anchors: [
126
- {
127
- score: 1,
128
- label: "Not established",
129
- description: "No repeatable practice or supporting evidence is available."
130
- },
131
- {
132
- score: 2,
133
- label: "Ad hoc",
134
- description: "A few activities happen, with inconsistent ownership and limited evidence."
135
- },
136
- {
137
- score: 3,
138
- label: "Defined",
139
- description: "An agreed practice has an owner and is used for the intended scope."
140
- },
141
- {
142
- score: 4,
143
- label: "Measured",
144
- description: "The practice is consistently applied and reviewed using evidence."
145
- },
146
- {
147
- score: 5,
148
- label: "Improving",
149
- description: "Measured outcomes guide regular improvements and wider reuse."
150
- }
151
- ],
152
- recommendations: {
153
- low: "Agree an owner and gather evidence: Are investment assumptions reviewed using evidence?",
154
- medium: "Test consistent use and measure the outcome: Are investment assumptions reviewed using evidence?",
155
- high: "Review evidence and improve the practice: Are investment assumptions reviewed using evidence?"
156
- }
157
- },
158
- {
159
- id: "strategy-5",
160
- text: "Are decisions to scale or stop tied to agreed measures?",
161
- anchors: [
162
- {
163
- score: 1,
164
- label: "Not established",
165
- description: "No repeatable practice or supporting evidence is available."
166
- },
167
- {
168
- score: 2,
169
- label: "Ad hoc",
170
- description: "A few activities happen, with inconsistent ownership and limited evidence."
171
- },
172
- {
173
- score: 3,
174
- label: "Defined",
175
- description: "An agreed practice has an owner and is used for the intended scope."
176
- },
177
- {
178
- score: 4,
179
- label: "Measured",
180
- description: "The practice is consistently applied and reviewed using evidence."
181
- },
182
- {
183
- score: 5,
184
- label: "Improving",
185
- description: "Measured outcomes guide regular improvements and wider reuse."
186
- }
187
- ],
188
- recommendations: {
189
- low: "Agree an owner and gather evidence: Are decisions to scale or stop tied to agreed measures?",
190
- medium: "Test consistent use and measure the outcome: Are decisions to scale or stop tied to agreed measures?",
191
- high: "Review evidence and improve the practice: Are decisions to scale or stop tied to agreed measures?"
192
- }
193
- }
194
- ]
195
- },
196
- {
197
- id: "data",
198
- label: "Data foundations",
199
- weight: 0.2,
200
- questions: [
201
- {
202
- id: "data-1",
203
- text: "Are required data sources identified and owned?",
204
- anchors: [
205
- {
206
- score: 1,
207
- label: "Not established",
208
- description: "No repeatable practice or supporting evidence is available."
209
- },
210
- {
211
- score: 2,
212
- label: "Ad hoc",
213
- description: "A few activities happen, with inconsistent ownership and limited evidence."
214
- },
215
- {
216
- score: 3,
217
- label: "Defined",
218
- description: "An agreed practice has an owner and is used for the intended scope."
219
- },
220
- {
221
- score: 4,
222
- label: "Measured",
223
- description: "The practice is consistently applied and reviewed using evidence."
224
- },
225
- {
226
- score: 5,
227
- label: "Improving",
228
- description: "Measured outcomes guide regular improvements and wider reuse."
229
- }
230
- ],
231
- recommendations: {
232
- low: "Agree an owner and gather evidence: Are required data sources identified and owned?",
233
- medium: "Test consistent use and measure the outcome: Are required data sources identified and owned?",
234
- high: "Review evidence and improve the practice: Are required data sources identified and owned?"
235
- }
236
- },
237
- {
238
- id: "data-2",
239
- text: "Is data quality measured for the intended use?",
240
- anchors: [
241
- {
242
- score: 1,
243
- label: "Not established",
244
- description: "No repeatable practice or supporting evidence is available."
245
- },
246
- {
247
- score: 2,
248
- label: "Ad hoc",
249
- description: "A few activities happen, with inconsistent ownership and limited evidence."
250
- },
251
- {
252
- score: 3,
253
- label: "Defined",
254
- description: "An agreed practice has an owner and is used for the intended scope."
255
- },
256
- {
257
- score: 4,
258
- label: "Measured",
259
- description: "The practice is consistently applied and reviewed using evidence."
260
- },
261
- {
262
- score: 5,
263
- label: "Improving",
264
- description: "Measured outcomes guide regular improvements and wider reuse."
265
- }
266
- ],
267
- recommendations: {
268
- low: "Agree an owner and gather evidence: Is data quality measured for the intended use?",
269
- medium: "Test consistent use and measure the outcome: Is data quality measured for the intended use?",
270
- high: "Review evidence and improve the practice: Is data quality measured for the intended use?"
271
- }
272
- },
273
- {
274
- id: "data-3",
275
- text: "Are access controls and lawful use understood?",
276
- anchors: [
277
- {
278
- score: 1,
279
- label: "Not established",
280
- description: "No repeatable practice or supporting evidence is available."
281
- },
282
- {
283
- score: 2,
284
- label: "Ad hoc",
285
- description: "A few activities happen, with inconsistent ownership and limited evidence."
286
- },
287
- {
288
- score: 3,
289
- label: "Defined",
290
- description: "An agreed practice has an owner and is used for the intended scope."
291
- },
292
- {
293
- score: 4,
294
- label: "Measured",
295
- description: "The practice is consistently applied and reviewed using evidence."
296
- },
297
- {
298
- score: 5,
299
- label: "Improving",
300
- description: "Measured outcomes guide regular improvements and wider reuse."
301
- }
302
- ],
303
- recommendations: {
304
- low: "Agree an owner and gather evidence: Are access controls and lawful use understood?",
305
- medium: "Test consistent use and measure the outcome: Are access controls and lawful use understood?",
306
- high: "Review evidence and improve the practice: Are access controls and lawful use understood?"
307
- }
308
- },
309
- {
310
- id: "data-4",
311
- text: "Can data lineage and changes be traced?",
312
- anchors: [
313
- {
314
- score: 1,
315
- label: "Not established",
316
- description: "No repeatable practice or supporting evidence is available."
317
- },
318
- {
319
- score: 2,
320
- label: "Ad hoc",
321
- description: "A few activities happen, with inconsistent ownership and limited evidence."
322
- },
323
- {
324
- score: 3,
325
- label: "Defined",
326
- description: "An agreed practice has an owner and is used for the intended scope."
327
- },
328
- {
329
- score: 4,
330
- label: "Measured",
331
- description: "The practice is consistently applied and reviewed using evidence."
332
- },
333
- {
334
- score: 5,
335
- label: "Improving",
336
- description: "Measured outcomes guide regular improvements and wider reuse."
337
- }
338
- ],
339
- recommendations: {
340
- low: "Agree an owner and gather evidence: Can data lineage and changes be traced?",
341
- medium: "Test consistent use and measure the outcome: Can data lineage and changes be traced?",
342
- high: "Review evidence and improve the practice: Can data lineage and changes be traced?"
343
- }
344
- },
345
- {
346
- id: "data-5",
347
- text: "Are data issues monitored and resolved by named roles?",
348
- anchors: [
349
- {
350
- score: 1,
351
- label: "Not established",
352
- description: "No repeatable practice or supporting evidence is available."
353
- },
354
- {
355
- score: 2,
356
- label: "Ad hoc",
357
- description: "A few activities happen, with inconsistent ownership and limited evidence."
358
- },
359
- {
360
- score: 3,
361
- label: "Defined",
362
- description: "An agreed practice has an owner and is used for the intended scope."
363
- },
364
- {
365
- score: 4,
366
- label: "Measured",
367
- description: "The practice is consistently applied and reviewed using evidence."
368
- },
369
- {
370
- score: 5,
371
- label: "Improving",
372
- description: "Measured outcomes guide regular improvements and wider reuse."
373
- }
374
- ],
375
- recommendations: {
376
- low: "Agree an owner and gather evidence: Are data issues monitored and resolved by named roles?",
377
- medium: "Test consistent use and measure the outcome: Are data issues monitored and resolved by named roles?",
378
- high: "Review evidence and improve the practice: Are data issues monitored and resolved by named roles?"
379
- }
380
- }
381
- ]
382
- },
383
- {
384
- id: "technology",
385
- label: "Technology and platforms",
386
- weight: 0.15,
387
- questions: [
388
- {
389
- id: "technology-1",
390
- text: "Are model and platform choices documented against needs?",
391
- anchors: [
392
- {
393
- score: 1,
394
- label: "Not established",
395
- description: "No repeatable practice or supporting evidence is available."
396
- },
397
- {
398
- score: 2,
399
- label: "Ad hoc",
400
- description: "A few activities happen, with inconsistent ownership and limited evidence."
401
- },
402
- {
403
- score: 3,
404
- label: "Defined",
405
- description: "An agreed practice has an owner and is used for the intended scope."
406
- },
407
- {
408
- score: 4,
409
- label: "Measured",
410
- description: "The practice is consistently applied and reviewed using evidence."
411
- },
412
- {
413
- score: 5,
414
- label: "Improving",
415
- description: "Measured outcomes guide regular improvements and wider reuse."
416
- }
417
- ],
418
- recommendations: {
419
- low: "Agree an owner and gather evidence: Are model and platform choices documented against needs?",
420
- medium: "Test consistent use and measure the outcome: Are model and platform choices documented against needs?",
421
- high: "Review evidence and improve the practice: Are model and platform choices documented against needs?"
422
- }
423
- },
424
- {
425
- id: "technology-2",
426
- text: "Are integrations tested in a controlled environment?",
427
- anchors: [
428
- {
429
- score: 1,
430
- label: "Not established",
431
- description: "No repeatable practice or supporting evidence is available."
432
- },
433
- {
434
- score: 2,
435
- label: "Ad hoc",
436
- description: "A few activities happen, with inconsistent ownership and limited evidence."
437
- },
438
- {
439
- score: 3,
440
- label: "Defined",
441
- description: "An agreed practice has an owner and is used for the intended scope."
442
- },
443
- {
444
- score: 4,
445
- label: "Measured",
446
- description: "The practice is consistently applied and reviewed using evidence."
447
- },
448
- {
449
- score: 5,
450
- label: "Improving",
451
- description: "Measured outcomes guide regular improvements and wider reuse."
452
- }
453
- ],
454
- recommendations: {
455
- low: "Agree an owner and gather evidence: Are integrations tested in a controlled environment?",
456
- medium: "Test consistent use and measure the outcome: Are integrations tested in a controlled environment?",
457
- high: "Review evidence and improve the practice: Are integrations tested in a controlled environment?"
458
- }
459
- },
460
- {
461
- id: "technology-3",
462
- text: "Are reliability, cost and latency monitored?",
463
- anchors: [
464
- {
465
- score: 1,
466
- label: "Not established",
467
- description: "No repeatable practice or supporting evidence is available."
468
- },
469
- {
470
- score: 2,
471
- label: "Ad hoc",
472
- description: "A few activities happen, with inconsistent ownership and limited evidence."
473
- },
474
- {
475
- score: 3,
476
- label: "Defined",
477
- description: "An agreed practice has an owner and is used for the intended scope."
478
- },
479
- {
480
- score: 4,
481
- label: "Measured",
482
- description: "The practice is consistently applied and reviewed using evidence."
483
- },
484
- {
485
- score: 5,
486
- label: "Improving",
487
- description: "Measured outcomes guide regular improvements and wider reuse."
488
- }
489
- ],
490
- recommendations: {
491
- low: "Agree an owner and gather evidence: Are reliability, cost and latency monitored?",
492
- medium: "Test consistent use and measure the outcome: Are reliability, cost and latency monitored?",
493
- high: "Review evidence and improve the practice: Are reliability, cost and latency monitored?"
494
- }
495
- },
496
- {
497
- id: "technology-4",
498
- text: "Are evaluation and rollback mechanisms in place?",
499
- anchors: [
500
- {
501
- score: 1,
502
- label: "Not established",
503
- description: "No repeatable practice or supporting evidence is available."
504
- },
505
- {
506
- score: 2,
507
- label: "Ad hoc",
508
- description: "A few activities happen, with inconsistent ownership and limited evidence."
509
- },
510
- {
511
- score: 3,
512
- label: "Defined",
513
- description: "An agreed practice has an owner and is used for the intended scope."
514
- },
515
- {
516
- score: 4,
517
- label: "Measured",
518
- description: "The practice is consistently applied and reviewed using evidence."
519
- },
520
- {
521
- score: 5,
522
- label: "Improving",
523
- description: "Measured outcomes guide regular improvements and wider reuse."
524
- }
525
- ],
526
- recommendations: {
527
- low: "Agree an owner and gather evidence: Are evaluation and rollback mechanisms in place?",
528
- medium: "Test consistent use and measure the outcome: Are evaluation and rollback mechanisms in place?",
529
- high: "Review evidence and improve the practice: Are evaluation and rollback mechanisms in place?"
530
- }
531
- },
532
- {
533
- id: "technology-5",
534
- text: "Can the service be operated and changed without vendor lock-in?",
535
- anchors: [
536
- {
537
- score: 1,
538
- label: "Not established",
539
- description: "No repeatable practice or supporting evidence is available."
540
- },
541
- {
542
- score: 2,
543
- label: "Ad hoc",
544
- description: "A few activities happen, with inconsistent ownership and limited evidence."
545
- },
546
- {
547
- score: 3,
548
- label: "Defined",
549
- description: "An agreed practice has an owner and is used for the intended scope."
550
- },
551
- {
552
- score: 4,
553
- label: "Measured",
554
- description: "The practice is consistently applied and reviewed using evidence."
555
- },
556
- {
557
- score: 5,
558
- label: "Improving",
559
- description: "Measured outcomes guide regular improvements and wider reuse."
560
- }
561
- ],
562
- recommendations: {
563
- low: "Agree an owner and gather evidence: Can the service be operated and changed without vendor lock-in?",
564
- medium: "Test consistent use and measure the outcome: Can the service be operated and changed without vendor lock-in?",
565
- high: "Review evidence and improve the practice: Can the service be operated and changed without vendor lock-in?"
566
- }
567
- }
568
- ]
569
- },
570
- {
571
- id: "people",
572
- label: "People and skills",
573
- weight: 0.15,
574
- questions: [
575
- {
576
- id: "people-1",
577
- text: "Do affected colleagues understand the intended workflow?",
578
- anchors: [
579
- {
580
- score: 1,
581
- label: "Not established",
582
- description: "No repeatable practice or supporting evidence is available."
583
- },
584
- {
585
- score: 2,
586
- label: "Ad hoc",
587
- description: "A few activities happen, with inconsistent ownership and limited evidence."
588
- },
589
- {
590
- score: 3,
591
- label: "Defined",
592
- description: "An agreed practice has an owner and is used for the intended scope."
593
- },
594
- {
595
- score: 4,
596
- label: "Measured",
597
- description: "The practice is consistently applied and reviewed using evidence."
598
- },
599
- {
600
- score: 5,
601
- label: "Improving",
602
- description: "Measured outcomes guide regular improvements and wider reuse."
603
- }
604
- ],
605
- recommendations: {
606
- low: "Agree an owner and gather evidence: Do affected colleagues understand the intended workflow?",
607
- medium: "Test consistent use and measure the outcome: Do affected colleagues understand the intended workflow?",
608
- high: "Review evidence and improve the practice: Do affected colleagues understand the intended workflow?"
609
- }
610
- },
611
- {
612
- id: "people-2",
613
- text: "Are practical AI skills matched to the roles involved?",
614
- anchors: [
615
- {
616
- score: 1,
617
- label: "Not established",
618
- description: "No repeatable practice or supporting evidence is available."
619
- },
620
- {
621
- score: 2,
622
- label: "Ad hoc",
623
- description: "A few activities happen, with inconsistent ownership and limited evidence."
624
- },
625
- {
626
- score: 3,
627
- label: "Defined",
628
- description: "An agreed practice has an owner and is used for the intended scope."
629
- },
630
- {
631
- score: 4,
632
- label: "Measured",
633
- description: "The practice is consistently applied and reviewed using evidence."
634
- },
635
- {
636
- score: 5,
637
- label: "Improving",
638
- description: "Measured outcomes guide regular improvements and wider reuse."
639
- }
640
- ],
641
- recommendations: {
642
- low: "Agree an owner and gather evidence: Are practical AI skills matched to the roles involved?",
643
- medium: "Test consistent use and measure the outcome: Are practical AI skills matched to the roles involved?",
644
- high: "Review evidence and improve the practice: Are practical AI skills matched to the roles involved?"
645
- }
646
- },
647
- {
648
- id: "people-3",
649
- text: "Are users involved in design and evaluation?",
650
- anchors: [
651
- {
652
- score: 1,
653
- label: "Not established",
654
- description: "No repeatable practice or supporting evidence is available."
655
- },
656
- {
657
- score: 2,
658
- label: "Ad hoc",
659
- description: "A few activities happen, with inconsistent ownership and limited evidence."
660
- },
661
- {
662
- score: 3,
663
- label: "Defined",
664
- description: "An agreed practice has an owner and is used for the intended scope."
665
- },
666
- {
667
- score: 4,
668
- label: "Measured",
669
- description: "The practice is consistently applied and reviewed using evidence."
670
- },
671
- {
672
- score: 5,
673
- label: "Improving",
674
- description: "Measured outcomes guide regular improvements and wider reuse."
675
- }
676
- ],
677
- recommendations: {
678
- low: "Agree an owner and gather evidence: Are users involved in design and evaluation?",
679
- medium: "Test consistent use and measure the outcome: Are users involved in design and evaluation?",
680
- high: "Review evidence and improve the practice: Are users involved in design and evaluation?"
681
- }
682
- },
683
- {
684
- id: "people-4",
685
- text: "Is adoption supported with time, training and feedback?",
686
- anchors: [
687
- {
688
- score: 1,
689
- label: "Not established",
690
- description: "No repeatable practice or supporting evidence is available."
691
- },
692
- {
693
- score: 2,
694
- label: "Ad hoc",
695
- description: "A few activities happen, with inconsistent ownership and limited evidence."
696
- },
697
- {
698
- score: 3,
699
- label: "Defined",
700
- description: "An agreed practice has an owner and is used for the intended scope."
701
- },
702
- {
703
- score: 4,
704
- label: "Measured",
705
- description: "The practice is consistently applied and reviewed using evidence."
706
- },
707
- {
708
- score: 5,
709
- label: "Improving",
710
- description: "Measured outcomes guide regular improvements and wider reuse."
711
- }
712
- ],
713
- recommendations: {
714
- low: "Agree an owner and gather evidence: Is adoption supported with time, training and feedback?",
715
- medium: "Test consistent use and measure the outcome: Is adoption supported with time, training and feedback?",
716
- high: "Review evidence and improve the practice: Is adoption supported with time, training and feedback?"
717
- }
718
- },
719
- {
720
- id: "people-5",
721
- text: "Are skills and behaviour changes measured over time?",
722
- anchors: [
723
- {
724
- score: 1,
725
- label: "Not established",
726
- description: "No repeatable practice or supporting evidence is available."
727
- },
728
- {
729
- score: 2,
730
- label: "Ad hoc",
731
- description: "A few activities happen, with inconsistent ownership and limited evidence."
732
- },
733
- {
734
- score: 3,
735
- label: "Defined",
736
- description: "An agreed practice has an owner and is used for the intended scope."
737
- },
738
- {
739
- score: 4,
740
- label: "Measured",
741
- description: "The practice is consistently applied and reviewed using evidence."
742
- },
743
- {
744
- score: 5,
745
- label: "Improving",
746
- description: "Measured outcomes guide regular improvements and wider reuse."
747
- }
748
- ],
749
- recommendations: {
750
- low: "Agree an owner and gather evidence: Are skills and behaviour changes measured over time?",
751
- medium: "Test consistent use and measure the outcome: Are skills and behaviour changes measured over time?",
752
- high: "Review evidence and improve the practice: Are skills and behaviour changes measured over time?"
753
- }
754
- }
755
- ]
756
- },
757
- {
758
- id: "governance",
759
- label: "Governance, risk and compliance",
760
- weight: 0.15,
761
- questions: [
762
- {
763
- id: "governance-1",
764
- text: "Are intended use and foreseeable harms documented?",
765
- anchors: [
766
- {
767
- score: 1,
768
- label: "Not established",
769
- description: "No repeatable practice or supporting evidence is available."
770
- },
771
- {
772
- score: 2,
773
- label: "Ad hoc",
774
- description: "A few activities happen, with inconsistent ownership and limited evidence."
775
- },
776
- {
777
- score: 3,
778
- label: "Defined",
779
- description: "An agreed practice has an owner and is used for the intended scope."
780
- },
781
- {
782
- score: 4,
783
- label: "Measured",
784
- description: "The practice is consistently applied and reviewed using evidence."
785
- },
786
- {
787
- score: 5,
788
- label: "Improving",
789
- description: "Measured outcomes guide regular improvements and wider reuse."
790
- }
791
- ],
792
- recommendations: {
793
- low: "Agree an owner and gather evidence: Are intended use and foreseeable harms documented?",
794
- medium: "Test consistent use and measure the outcome: Are intended use and foreseeable harms documented?",
795
- high: "Review evidence and improve the practice: Are intended use and foreseeable harms documented?"
796
- }
797
- },
798
- {
799
- id: "governance-2",
800
- text: "Are accountable risk owners and review routes named?",
801
- anchors: [
802
- {
803
- score: 1,
804
- label: "Not established",
805
- description: "No repeatable practice or supporting evidence is available."
806
- },
807
- {
808
- score: 2,
809
- label: "Ad hoc",
810
- description: "A few activities happen, with inconsistent ownership and limited evidence."
811
- },
812
- {
813
- score: 3,
814
- label: "Defined",
815
- description: "An agreed practice has an owner and is used for the intended scope."
816
- },
817
- {
818
- score: 4,
819
- label: "Measured",
820
- description: "The practice is consistently applied and reviewed using evidence."
821
- },
822
- {
823
- score: 5,
824
- label: "Improving",
825
- description: "Measured outcomes guide regular improvements and wider reuse."
826
- }
827
- ],
828
- recommendations: {
829
- low: "Agree an owner and gather evidence: Are accountable risk owners and review routes named?",
830
- medium: "Test consistent use and measure the outcome: Are accountable risk owners and review routes named?",
831
- high: "Review evidence and improve the practice: Are accountable risk owners and review routes named?"
832
- }
833
- },
834
- {
835
- id: "governance-3",
836
- text: "Are privacy, security and legal constraints assessed?",
837
- anchors: [
838
- {
839
- score: 1,
840
- label: "Not established",
841
- description: "No repeatable practice or supporting evidence is available."
842
- },
843
- {
844
- score: 2,
845
- label: "Ad hoc",
846
- description: "A few activities happen, with inconsistent ownership and limited evidence."
847
- },
848
- {
849
- score: 3,
850
- label: "Defined",
851
- description: "An agreed practice has an owner and is used for the intended scope."
852
- },
853
- {
854
- score: 4,
855
- label: "Measured",
856
- description: "The practice is consistently applied and reviewed using evidence."
857
- },
858
- {
859
- score: 5,
860
- label: "Improving",
861
- description: "Measured outcomes guide regular improvements and wider reuse."
862
- }
863
- ],
864
- recommendations: {
865
- low: "Agree an owner and gather evidence: Are privacy, security and legal constraints assessed?",
866
- medium: "Test consistent use and measure the outcome: Are privacy, security and legal constraints assessed?",
867
- high: "Review evidence and improve the practice: Are privacy, security and legal constraints assessed?"
868
- }
869
- },
870
- {
871
- id: "governance-4",
872
- text: "Are human oversight and incident routes tested?",
873
- anchors: [
874
- {
875
- score: 1,
876
- label: "Not established",
877
- description: "No repeatable practice or supporting evidence is available."
878
- },
879
- {
880
- score: 2,
881
- label: "Ad hoc",
882
- description: "A few activities happen, with inconsistent ownership and limited evidence."
883
- },
884
- {
885
- score: 3,
886
- label: "Defined",
887
- description: "An agreed practice has an owner and is used for the intended scope."
888
- },
889
- {
890
- score: 4,
891
- label: "Measured",
892
- description: "The practice is consistently applied and reviewed using evidence."
893
- },
894
- {
895
- score: 5,
896
- label: "Improving",
897
- description: "Measured outcomes guide regular improvements and wider reuse."
898
- }
899
- ],
900
- recommendations: {
901
- low: "Agree an owner and gather evidence: Are human oversight and incident routes tested?",
902
- medium: "Test consistent use and measure the outcome: Are human oversight and incident routes tested?",
903
- high: "Review evidence and improve the practice: Are human oversight and incident routes tested?"
904
- }
905
- },
906
- {
907
- id: "governance-5",
908
- text: "Are governance controls reviewed when the system changes?",
909
- anchors: [
910
- {
911
- score: 1,
912
- label: "Not established",
913
- description: "No repeatable practice or supporting evidence is available."
914
- },
915
- {
916
- score: 2,
917
- label: "Ad hoc",
918
- description: "A few activities happen, with inconsistent ownership and limited evidence."
919
- },
920
- {
921
- score: 3,
922
- label: "Defined",
923
- description: "An agreed practice has an owner and is used for the intended scope."
924
- },
925
- {
926
- score: 4,
927
- label: "Measured",
928
- description: "The practice is consistently applied and reviewed using evidence."
929
- },
930
- {
931
- score: 5,
932
- label: "Improving",
933
- description: "Measured outcomes guide regular improvements and wider reuse."
934
- }
935
- ],
936
- recommendations: {
937
- low: "Agree an owner and gather evidence: Are governance controls reviewed when the system changes?",
938
- medium: "Test consistent use and measure the outcome: Are governance controls reviewed when the system changes?",
939
- high: "Review evidence and improve the practice: Are governance controls reviewed when the system changes?"
940
- }
941
- }
942
- ]
943
- },
944
- {
945
- id: "delivery",
946
- label: "Delivery and operating model",
947
- weight: 0.15,
948
- questions: [
949
- {
950
- id: "delivery-1",
951
- text: "Is a team accountable for delivering and running the service?",
952
- anchors: [
953
- {
954
- score: 1,
955
- label: "Not established",
956
- description: "No repeatable practice or supporting evidence is available."
957
- },
958
- {
959
- score: 2,
960
- label: "Ad hoc",
961
- description: "A few activities happen, with inconsistent ownership and limited evidence."
962
- },
963
- {
964
- score: 3,
965
- label: "Defined",
966
- description: "An agreed practice has an owner and is used for the intended scope."
967
- },
968
- {
969
- score: 4,
970
- label: "Measured",
971
- description: "The practice is consistently applied and reviewed using evidence."
972
- },
973
- {
974
- score: 5,
975
- label: "Improving",
976
- description: "Measured outcomes guide regular improvements and wider reuse."
977
- }
978
- ],
979
- recommendations: {
980
- low: "Agree an owner and gather evidence: Is a team accountable for delivering and running the service?",
981
- medium: "Test consistent use and measure the outcome: Is a team accountable for delivering and running the service?",
982
- high: "Review evidence and improve the practice: Is a team accountable for delivering and running the service?"
983
- }
984
- },
985
- {
986
- id: "delivery-2",
987
- text: "Is the work planned around outcomes and small increments?",
988
- anchors: [
989
- {
990
- score: 1,
991
- label: "Not established",
992
- description: "No repeatable practice or supporting evidence is available."
993
- },
994
- {
995
- score: 2,
996
- label: "Ad hoc",
997
- description: "A few activities happen, with inconsistent ownership and limited evidence."
998
- },
999
- {
1000
- score: 3,
1001
- label: "Defined",
1002
- description: "An agreed practice has an owner and is used for the intended scope."
1003
- },
1004
- {
1005
- score: 4,
1006
- label: "Measured",
1007
- description: "The practice is consistently applied and reviewed using evidence."
1008
- },
1009
- {
1010
- score: 5,
1011
- label: "Improving",
1012
- description: "Measured outcomes guide regular improvements and wider reuse."
1013
- }
1014
- ],
1015
- recommendations: {
1016
- low: "Agree an owner and gather evidence: Is the work planned around outcomes and small increments?",
1017
- medium: "Test consistent use and measure the outcome: Is the work planned around outcomes and small increments?",
1018
- high: "Review evidence and improve the practice: Is the work planned around outcomes and small increments?"
1019
- }
1020
- },
1021
- {
1022
- id: "delivery-3",
1023
- text: "Are delivery flow and service measures visible?",
1024
- anchors: [
1025
- {
1026
- score: 1,
1027
- label: "Not established",
1028
- description: "No repeatable practice or supporting evidence is available."
1029
- },
1030
- {
1031
- score: 2,
1032
- label: "Ad hoc",
1033
- description: "A few activities happen, with inconsistent ownership and limited evidence."
1034
- },
1035
- {
1036
- score: 3,
1037
- label: "Defined",
1038
- description: "An agreed practice has an owner and is used for the intended scope."
1039
- },
1040
- {
1041
- score: 4,
1042
- label: "Measured",
1043
- description: "The practice is consistently applied and reviewed using evidence."
1044
- },
1045
- {
1046
- score: 5,
1047
- label: "Improving",
1048
- description: "Measured outcomes guide regular improvements and wider reuse."
1049
- }
1050
- ],
1051
- recommendations: {
1052
- low: "Agree an owner and gather evidence: Are delivery flow and service measures visible?",
1053
- medium: "Test consistent use and measure the outcome: Are delivery flow and service measures visible?",
1054
- high: "Review evidence and improve the practice: Are delivery flow and service measures visible?"
1055
- }
1056
- },
1057
- {
1058
- id: "delivery-4",
1059
- text: "Are operating responsibilities and handovers documented?",
1060
- anchors: [
1061
- {
1062
- score: 1,
1063
- label: "Not established",
1064
- description: "No repeatable practice or supporting evidence is available."
1065
- },
1066
- {
1067
- score: 2,
1068
- label: "Ad hoc",
1069
- description: "A few activities happen, with inconsistent ownership and limited evidence."
1070
- },
1071
- {
1072
- score: 3,
1073
- label: "Defined",
1074
- description: "An agreed practice has an owner and is used for the intended scope."
1075
- },
1076
- {
1077
- score: 4,
1078
- label: "Measured",
1079
- description: "The practice is consistently applied and reviewed using evidence."
1080
- },
1081
- {
1082
- score: 5,
1083
- label: "Improving",
1084
- description: "Measured outcomes guide regular improvements and wider reuse."
1085
- }
1086
- ],
1087
- recommendations: {
1088
- low: "Agree an owner and gather evidence: Are operating responsibilities and handovers documented?",
1089
- medium: "Test consistent use and measure the outcome: Are operating responsibilities and handovers documented?",
1090
- high: "Review evidence and improve the practice: Are operating responsibilities and handovers documented?"
1091
- }
1092
- },
1093
- {
1094
- id: "delivery-5",
1095
- text: "Are improvements driven by feedback from production use?",
1096
- anchors: [
1097
- {
1098
- score: 1,
1099
- label: "Not established",
1100
- description: "No repeatable practice or supporting evidence is available."
1101
- },
1102
- {
1103
- score: 2,
1104
- label: "Ad hoc",
1105
- description: "A few activities happen, with inconsistent ownership and limited evidence."
1106
- },
1107
- {
1108
- score: 3,
1109
- label: "Defined",
1110
- description: "An agreed practice has an owner and is used for the intended scope."
1111
- },
1112
- {
1113
- score: 4,
1114
- label: "Measured",
1115
- description: "The practice is consistently applied and reviewed using evidence."
1116
- },
1117
- {
1118
- score: 5,
1119
- label: "Improving",
1120
- description: "Measured outcomes guide regular improvements and wider reuse."
1121
- }
1122
- ],
1123
- recommendations: {
1124
- low: "Agree an owner and gather evidence: Are improvements driven by feedback from production use?",
1125
- medium: "Test consistent use and measure the outcome: Are improvements driven by feedback from production use?",
1126
- high: "Review evidence and improve the practice: Are improvements driven by feedback from production use?"
1127
- }
1128
- }
1129
- ]
1130
- }
1131
- ],
1132
- bands: [
1133
- {
1134
- name: "Exploring",
1135
- minimum: 1,
1136
- maximumExclusive: 1.8
1137
- },
1138
- {
1139
- name: "Experimenting",
1140
- minimum: 1.8,
1141
- maximumExclusive: 2.6
1142
- },
1143
- {
1144
- name: "Scaling",
1145
- minimum: 2.6,
1146
- maximumExclusive: 3.4
1147
- },
1148
- {
1149
- name: "Embedded",
1150
- minimum: 3.4,
1151
- maximumExclusive: 4.2
1152
- },
1153
- {
1154
- name: "Leading",
1155
- minimum: 4.2,
1156
- maximumExclusive: 5.000001
1157
- }
1158
- ],
1159
- limitations: [
1160
- "Self-assessment, not a certification or legal advice.",
1161
- "Maturity bands require at least 80% response coverage."
1162
- ],
1163
- contentCredit: "Tenhaw AI Readiness Framework, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), https://tenhaw.com."
1164
- };
1165
-
1166
- // src/index.ts
1167
- function loadFramework(version = "v1") {
1168
- invariant(version === "v1", "/version", "Only framework v1 is supported");
1169
- return structuredClone(framework_default);
1170
- }
1171
- function validateResponses(input) {
1172
- const result = validateInput("readiness-response", input);
1173
- const ids = result.answers.map((a) => a.questionId);
1174
- invariant(new Set(ids).size === ids.length, "/answers", "Each question can be answered only once");
1175
- return result;
1176
- }
1177
- function scoreReadiness(input, options = {}) {
1178
- const responses = validateResponses(input);
1179
- const known = new Set(framework_default.dimensions.map((d) => d.id));
1180
- for (const [key, value] of Object.entries(options.weights ?? {})) invariant(known.has(key) && typeof value === "number" && Number.isFinite(value) && value >= 0, `/weights/${key}`, "Use a known dimension and a finite nonnegative weight");
1181
- const rawWeights = framework_default.dimensions.map((d) => options.weights?.[d.id] ?? d.weight);
1182
- const totalWeight = rawWeights.reduce((a, b) => a + b, 0);
1183
- invariant(Number.isFinite(totalWeight) && totalWeight > 0, "/weights", "At least one dimension weight must be positive and the sum must be finite");
1184
- const weights = rawWeights.map((w) => w / totalWeight);
1185
- const dimensions = framework_default.dimensions.map((d, index) => {
1186
- const answers = responses.answers.filter((a) => a.questionId.startsWith(`${d.id}-`));
1187
- return { id: d.id, label: d.label, weight: round(weights[index]), score: answers.length ? round(answers.reduce((s, a) => s + a.score, 0) / answers.length) : null, answered: answers.length, total: d.questions.length, coverage: round(answers.length / d.questions.length) };
1188
- });
1189
- const presentWeight = dimensions.reduce((s, d, i) => s + (d.score !== null ? weights[i] : 0), 0);
1190
- const overall = presentWeight > 0 ? round(dimensions.reduce((s, d, i) => s + (d.score === null ? 0 : d.score * weights[i]), 0) / presentWeight) : null;
1191
- const coverage = round(responses.answers.length / 30);
1192
- const band = overall !== null && coverage >= framework_default.minimumBandCoverage ? framework_default.bands.find((b) => overall >= b.minimum && overall < b.maximumExclusive)?.name ?? null : null;
1193
- const gaps = responses.answers.filter((a) => a.score <= 2).map((a) => {
1194
- const dimensionId = a.questionId.split("-")[0];
1195
- const index = framework_default.dimensions.findIndex((d) => d.id === dimensionId);
1196
- const question = framework_default.dimensions[index].questions.find((q) => q.id === a.questionId);
1197
- return { questionId: a.questionId, dimensionId, score: a.score, priority: round(weights[index] * (5 - a.score)), recommendation: question.recommendations.low };
1198
- }).sort((a, b) => b.priority - a.priority || a.questionId.localeCompare(b.questionId));
1199
- return { frameworkVersion: "v1", contentCredit: framework_default.contentCredit, overall, band, coverage, dimensions, gaps, recommendations: gaps.map((g) => ({ questionId: g.questionId, action: g.recommendation })), limitations: [...framework_default.limitations] };
1200
- }
1201
- function renderReadinessReport(report, format, options = {}) {
1202
- const method = "Method: mean of answered questions per dimension; weighted mean renormalised over answered dimensions. Coverage is response coverage, not statistical confidence.";
1203
- const body = renderReport(report, format, { content: "ai-readiness", ...options });
1204
- if (format === "html") return body.replace("</main>", `<p>${escapeHtml(report.contentCredit)} ${escapeHtml(method)}</p></main>`);
1205
- return format === "md" ? `${body}
1206
- ${method}
1207
- ` : body;
1208
- }
1209
- export {
1210
- loadFramework,
1211
- renderReadinessReport,
1212
- scoreReadiness,
1213
- validateResponses
1214
- };