@aibvf/core 0.11.1 → 0.12.0
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/aliases.js +1 -1
- package/dist/aliases.js.map +1 -1
- package/dist/assessInitiative.d.ts +9 -1
- package/dist/assessInitiative.d.ts.map +1 -1
- package/dist/assessInitiative.js +57 -11
- package/dist/assessInitiative.js.map +1 -1
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +1 -1
- package/dist/guidedQuestions.d.ts +16 -1
- package/dist/guidedQuestions.d.ts.map +1 -1
- package/dist/guidedQuestions.js +66 -5
- package/dist/guidedQuestions.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/plainResult.d.ts +24 -0
- package/dist/plainResult.d.ts.map +1 -0
- package/dist/plainResult.js +108 -0
- package/dist/plainResult.js.map +1 -0
- package/dist/plainResult.test.d.ts +2 -0
- package/dist/plainResult.test.d.ts.map +1 -0
- package/dist/plainResult.test.js +165 -0
- package/dist/plainResult.test.js.map +1 -0
- package/dist/proposalReading.d.ts +42 -0
- package/dist/proposalReading.d.ts.map +1 -0
- package/dist/proposalReading.js +59 -0
- package/dist/proposalReading.js.map +1 -0
- package/dist/proposalReading.test.d.ts +2 -0
- package/dist/proposalReading.test.d.ts.map +1 -0
- package/dist/proposalReading.test.js +79 -0
- package/dist/proposalReading.test.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The front-door result in everyday words: one sentence for the outcome,
|
|
3
|
+
* the answers that hold the initiative back, and the one thing to do first.
|
|
4
|
+
* Built only from what the user answered or supplied.
|
|
5
|
+
*/
|
|
6
|
+
import { FIRST_STEP, GO_AHEAD_STEP, QUESTION_SHORT, UNKNOWN_LABEL, WORDING, WORK_PARTS, WORK_PART_WORDING, } from './guidedQuestions.js';
|
|
7
|
+
/** The two answers that can stop the initiative come first, then the two a go-ahead needs. */
|
|
8
|
+
const PILLAR_ORDER = ['financial_return', 'governance_risk', 'strategic_alignment', 'change_enablement'];
|
|
9
|
+
const COUNT_WORDS = ['no', 'one', 'two', 'three', 'four', 'five'];
|
|
10
|
+
function clears(pillar, value) {
|
|
11
|
+
return pillar === 'governance_risk' ? value <= 40 : value >= 60;
|
|
12
|
+
}
|
|
13
|
+
function stops(pillar, value) {
|
|
14
|
+
return (pillar === 'governance_risk' && value >= 70) || (pillar === 'financial_return' && value <= 20);
|
|
15
|
+
}
|
|
16
|
+
/** What a contradicted answer needs, and the step that settles it. */
|
|
17
|
+
export const CONTRADICTION_NEEDED = 'The proposal and the answer have to agree. Change whichever one is wrong.';
|
|
18
|
+
export function contradictionStep(words) {
|
|
19
|
+
return `Your proposal says "${words}" and your answer says otherwise. Settle which one is true, then answer again.`;
|
|
20
|
+
}
|
|
21
|
+
function openWorkParts(work) {
|
|
22
|
+
return WORK_PARTS.filter((part) => work.checks.find((check) => check.id === part)?.status !== 'met');
|
|
23
|
+
}
|
|
24
|
+
export function plainResult(input) {
|
|
25
|
+
const { track, classification, supplied, answers, work } = input;
|
|
26
|
+
const wording = WORDING[track];
|
|
27
|
+
const failing = PILLAR_ORDER.filter((pillar) => supplied[pillar] !== undefined && !clears(pillar, supplied[pillar]));
|
|
28
|
+
// An answer that stops the initiative on its own leads the list. When both stop it,
|
|
29
|
+
// risk leads, which is the cause the verdict's reason names.
|
|
30
|
+
const rank = (pillar) => (!stops(pillar, supplied[pillar]) ? 2 : pillar === 'governance_risk' ? 0 : 1);
|
|
31
|
+
failing.sort((x, y) => rank(x) - rank(y));
|
|
32
|
+
const holdingBack = failing.map((pillar) => {
|
|
33
|
+
const answer = answers[pillar];
|
|
34
|
+
return {
|
|
35
|
+
id: pillar,
|
|
36
|
+
short: QUESTION_SHORT[track][pillar],
|
|
37
|
+
question: wording[pillar].question,
|
|
38
|
+
answer: answer ? answer.label : `A score of ${supplied[pillar]} out of 100.`,
|
|
39
|
+
needed: answer ? wording[pillar].c : pillar === 'governance_risk' ? 'A score of 40 or less.' : 'A score of 60 or more.',
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
// The work redesign holds the initiative back only once it has been asked about or supplied.
|
|
43
|
+
const pillarsClear = PILLAR_ORDER.every((pillar) => supplied[pillar] !== undefined && clears(pillar, supplied[pillar]));
|
|
44
|
+
const workBlocks = work.status !== 'ready' && (input.workAnswered || input.workUnknown || pillarsClear);
|
|
45
|
+
const stillOpen = openWorkParts(work);
|
|
46
|
+
if (workBlocks) {
|
|
47
|
+
const names = stillOpen.map((part) => WORK_PART_WORDING[track][part].name);
|
|
48
|
+
const answer = answers.work_architecture;
|
|
49
|
+
holdingBack.push({
|
|
50
|
+
id: 'work_architecture',
|
|
51
|
+
short: QUESTION_SHORT[track].work_architecture,
|
|
52
|
+
question: wording.work_architecture.question,
|
|
53
|
+
answer: answer ? answer.label : input.workUnknown || !input.workAnswered ? UNKNOWN_LABEL : `Not shown as changed: ${names.join(', ')}.`,
|
|
54
|
+
needed: wording.work_architecture.d,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// A contradicted answer holds the initiative back even though its score clears.
|
|
58
|
+
// When the same question already holds it back, the proposal's words are added to that entry.
|
|
59
|
+
const contradicted = new Map();
|
|
60
|
+
for (const item of input.contradictions ?? []) {
|
|
61
|
+
contradicted.set(item.id, item.proposal_words);
|
|
62
|
+
const existing = holdingBack.find((held) => held.id === item.id);
|
|
63
|
+
if (existing)
|
|
64
|
+
existing.proposal_words = item.proposal_words;
|
|
65
|
+
else
|
|
66
|
+
holdingBack.push({
|
|
67
|
+
id: item.id, short: QUESTION_SHORT[track][item.id], question: wording[item.id].question,
|
|
68
|
+
answer: item.answer, needed: CONTRADICTION_NEEDED, proposal_words: item.proposal_words,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (classification === 'Accelerate') {
|
|
72
|
+
const answered = Object.keys(answers).length > 0;
|
|
73
|
+
return {
|
|
74
|
+
summary: answered ? 'Go ahead. Your answers clear the bar on every question.' : 'Go ahead. Every score clears the bar.',
|
|
75
|
+
holding_back: [],
|
|
76
|
+
first_step: GO_AHEAD_STEP,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const first = holdingBack[0];
|
|
80
|
+
const firstStep = !first
|
|
81
|
+
? GO_AHEAD_STEP
|
|
82
|
+
: first.proposal_words && first.needed === CONTRADICTION_NEEDED
|
|
83
|
+
? contradictionStep(first.proposal_words)
|
|
84
|
+
: first.id === 'work_architecture'
|
|
85
|
+
? WORK_PART_WORDING[track][stillOpen[0] ?? 'workflow_redesigned'].step
|
|
86
|
+
: FIRST_STEP[track][first.id];
|
|
87
|
+
let summary;
|
|
88
|
+
if (classification === 'Stop') {
|
|
89
|
+
const stopper = failing.find((pillar) => stops(pillar, supplied[pillar]));
|
|
90
|
+
const answer = stopper ? answers[stopper] : undefined;
|
|
91
|
+
summary = answer
|
|
92
|
+
? `Stop. ${answer.label}`
|
|
93
|
+
: stopper === 'financial_return'
|
|
94
|
+
? 'Stop. The return is too thin for the cost.'
|
|
95
|
+
: 'Stop. The risk is above the level where this can go ahead.';
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
const count = holdingBack.length;
|
|
99
|
+
const things = `${COUNT_WORDS[count] ?? count} thing${count === 1 ? '' : 's'}`;
|
|
100
|
+
// The work question is asked only once the four answers clear, so it is still to come here.
|
|
101
|
+
const workStillToAsk = work.status !== 'ready' && !workBlocks;
|
|
102
|
+
summary = workStillToAsk
|
|
103
|
+
? `Fix ${things} first. The question on how the work changes comes after that.`
|
|
104
|
+
: `Fix ${things} before you go ahead.`;
|
|
105
|
+
}
|
|
106
|
+
return { summary, holding_back: holdingBack, first_step: firstStep };
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=plainResult.js.map
|
|
@@ -0,0 +1 @@
|
|
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;IAC3C,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plainResult.test.d.ts","sourceRoot":"","sources":["../src/plainResult.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { assessInitiative, CONTEXT_CHOICES } from './assessInitiative.js';
|
|
4
|
+
import { FIRST_STEP, GO_AHEAD_STEP, QUESTION_SHORT, QUESTION_WHY, WORDING, WORK_PART_WORDING, } from './guidedQuestions.js';
|
|
5
|
+
import { mapToTaxonomy } from './aliases.js';
|
|
6
|
+
const firm = 'We are a 12 person MSP. We want an AI agent to triage helpdesk tickets.';
|
|
7
|
+
const bank = 'A bank with 9,000 employees wants autonomous agents in customer service.';
|
|
8
|
+
const ok = { confirmed: true };
|
|
9
|
+
const clear = { financial_return: 'c', governance_risk: 'c', strategic_alignment: 'c', change_enablement: 'c' };
|
|
10
|
+
test('a stop says why in the words of the answer that caused it', () => {
|
|
11
|
+
const v = assessInitiative({ proposal: firm, ...ok, answers: { financial_return: 'a' } }).verdict;
|
|
12
|
+
assert.equal(v.classification, 'Stop');
|
|
13
|
+
assert.equal(v.summary, 'Stop. It costs more than it saves.');
|
|
14
|
+
assert.deepEqual(v.holding_back, [{
|
|
15
|
+
id: 'financial_return',
|
|
16
|
+
short: 'Cost and return',
|
|
17
|
+
question: 'What does it cost each month, and what does it save or earn?',
|
|
18
|
+
answer: 'It costs more than it saves.',
|
|
19
|
+
needed: 'It pays for itself within two years, on numbers we have checked.',
|
|
20
|
+
}]);
|
|
21
|
+
assert.equal(v.first_step, 'Write down what it costs each month and what it saves, and check the numbers.');
|
|
22
|
+
// The framework reason stays for callers that read it.
|
|
23
|
+
assert.equal(v.reason, 'Financial return too thin to justify scope.');
|
|
24
|
+
});
|
|
25
|
+
test('the answer that stops the initiative leads, whatever order the questions came in', () => {
|
|
26
|
+
const v = assessInitiative({ proposal: firm, ...ok, answers: { financial_return: 'b', governance_risk: 'a' } }).verdict;
|
|
27
|
+
assert.equal(v.classification, 'Stop');
|
|
28
|
+
assert.deepEqual(v.holding_back.map((h) => h.id), ['governance_risk', 'financial_return']);
|
|
29
|
+
assert.equal(v.summary, 'Stop. It deals with customers, money or personal data, and nobody checks it.');
|
|
30
|
+
assert.equal(v.first_step, FIRST_STEP.smaller_firm.governance_risk);
|
|
31
|
+
});
|
|
32
|
+
test('a fix counts what holds it back and names the first thing to do', () => {
|
|
33
|
+
const one = assessInitiative({ proposal: firm, ...ok, answers: { ...clear, change_enablement: 'b' } }).verdict;
|
|
34
|
+
assert.equal(one.classification, 'Fix');
|
|
35
|
+
assert.equal(one.summary, 'Fix one thing first. The question on how the work changes comes after that.');
|
|
36
|
+
assert.deepEqual(one.holding_back.map((h) => h.id), ['change_enablement']);
|
|
37
|
+
assert.equal(one.holding_back[0].answer, 'Someone is named, on top of their normal job.');
|
|
38
|
+
assert.equal(one.holding_back[0].needed, 'Someone is named and has time set aside.');
|
|
39
|
+
assert.equal(one.first_step, 'Name who makes this happen and set time aside for them.');
|
|
40
|
+
const three = assessInitiative({ proposal: firm, ...ok, answers: { financial_return: 'b', governance_risk: 'b', strategic_alignment: 'c', change_enablement: 'b' } }).verdict;
|
|
41
|
+
assert.equal(three.summary, 'Fix three things first. The question on how the work changes comes after that.');
|
|
42
|
+
assert.deepEqual(three.holding_back.map((h) => h.id), ['financial_return', 'governance_risk', 'change_enablement']);
|
|
43
|
+
assert.equal(three.first_step, FIRST_STEP.smaller_firm.financial_return);
|
|
44
|
+
});
|
|
45
|
+
test('a gap in the work redesign names the first part still to change', () => {
|
|
46
|
+
const measures = assessInitiative({ proposal: firm, ...ok, answers: { ...clear, work_architecture: 'c' } }).verdict;
|
|
47
|
+
assert.equal(measures.classification, 'Fix');
|
|
48
|
+
assert.equal(measures.summary, 'Fix one thing before you go ahead.');
|
|
49
|
+
assert.deepEqual(measures.holding_back, [{
|
|
50
|
+
id: 'work_architecture',
|
|
51
|
+
short: 'How the work changes',
|
|
52
|
+
question: 'What changes in how the work gets done?',
|
|
53
|
+
answer: 'We have rewritten the steps, who does what, and who decides or overrides.',
|
|
54
|
+
needed: 'All four: the steps, who does what, who decides, and how we judge good work.',
|
|
55
|
+
}]);
|
|
56
|
+
assert.equal(measures.first_step, 'Change how good work is judged, so people are measured on the new way of working.');
|
|
57
|
+
const nothing = assessInitiative({ proposal: firm, ...ok, answers: { ...clear, work_architecture: 'a' } }).verdict;
|
|
58
|
+
assert.equal(nothing.first_step, 'Write down the new steps of the job, with the AI in them.');
|
|
59
|
+
const unsure = assessInitiative({ proposal: firm, ...ok, answers: { ...clear, work_architecture: 'unknown' } }).verdict;
|
|
60
|
+
assert.equal(unsure.classification, 'Fix');
|
|
61
|
+
assert.equal(unsure.holding_back[0].answer, 'I do not know yet.');
|
|
62
|
+
assert.equal(unsure.first_step, WORK_PART_WORDING.smaller_firm.workflow_redesigned.step);
|
|
63
|
+
});
|
|
64
|
+
test('a go-ahead holds nothing back', () => {
|
|
65
|
+
const v = assessInitiative({ proposal: firm, ...ok, answers: { ...clear, work_architecture: 'd' } }).verdict;
|
|
66
|
+
assert.equal(v.classification, 'Accelerate');
|
|
67
|
+
assert.equal(v.summary, 'Go ahead. Your answers clear the bar on every question.');
|
|
68
|
+
assert.deepEqual(v.holding_back, []);
|
|
69
|
+
assert.equal(v.first_step, GO_AHEAD_STEP);
|
|
70
|
+
});
|
|
71
|
+
test('larger organisations get the same result in their own wording', () => {
|
|
72
|
+
const v = assessInitiative({ proposal: bank, ...ok, answers: { governance_risk: 'd', financial_return: 'd', strategic_alignment: 'd', change_enablement: 'd', work_architecture: 'b' } }).verdict;
|
|
73
|
+
assert.equal(v.classification, 'Fix');
|
|
74
|
+
assert.equal(v.holding_back[0].short, 'Redesign of the work');
|
|
75
|
+
assert.equal(v.holding_back[0].needed, WORDING.enterprise.work_architecture.d);
|
|
76
|
+
assert.equal(v.first_step, 'Rewrite the affected roles and accountabilities.');
|
|
77
|
+
});
|
|
78
|
+
test('supplied scores and work checks produce a plain result with no answer wording to quote', () => {
|
|
79
|
+
const stop = assessInitiative({ proposal: bank, ...ok, scores: { governance_risk: 82 } }).verdict;
|
|
80
|
+
assert.equal(stop.summary, 'Stop. The risk is above the level where this can go ahead.');
|
|
81
|
+
assert.equal(stop.holding_back[0].answer, 'A score of 82 out of 100.');
|
|
82
|
+
assert.equal(stop.holding_back[0].needed, 'A score of 40 or less.');
|
|
83
|
+
const thin = assessInitiative({ proposal: bank, ...ok, scores: { financial_return: 10 } }).verdict;
|
|
84
|
+
assert.equal(thin.summary, 'Stop. The return is too thin for the cost.');
|
|
85
|
+
assert.equal(thin.holding_back[0].needed, 'A score of 60 or more.');
|
|
86
|
+
const gap = assessInitiative({
|
|
87
|
+
proposal: bank, ...ok,
|
|
88
|
+
scores: { strategic_alignment: 75, financial_return: 70, change_enablement: 70, governance_risk: 30 },
|
|
89
|
+
work_architecture: { workflow_redesigned: true, roles_redesigned: false, decision_rights_defined: true, measures_updated: false },
|
|
90
|
+
}).verdict;
|
|
91
|
+
assert.equal(gap.classification, 'Fix');
|
|
92
|
+
assert.equal(gap.holding_back[0].answer, 'Not shown as changed: the roles, the measures people are judged on.');
|
|
93
|
+
assert.equal(gap.first_step, 'Rewrite the affected roles and accountabilities.');
|
|
94
|
+
});
|
|
95
|
+
test('each question says why it matters as the rule the engine applies, in the wording for the size', () => {
|
|
96
|
+
const small = assessInitiative({ proposal: firm, ...ok });
|
|
97
|
+
assert.equal(small.question?.why, 'If it costs more than it saves, the answer is stop.');
|
|
98
|
+
const large = assessInitiative({ proposal: bank, ...ok });
|
|
99
|
+
assert.equal(large.question?.why, 'Risk that nobody controls stops the initiative on its own.');
|
|
100
|
+
const unknown = assessInitiative({ proposal: firm, ...ok, answers: { financial_return: 'unknown', governance_risk: 'c', strategic_alignment: 'c', change_enablement: 'unknown' } });
|
|
101
|
+
assert.deepEqual(unknown.to_find_out?.map((f) => f.why), [QUESTION_WHY.smaller_firm.financial_return, QUESTION_WHY.smaller_firm.change_enablement]);
|
|
102
|
+
});
|
|
103
|
+
test('the context choices are ordered for a form and match the wording the engine reads back', () => {
|
|
104
|
+
assert.equal(CONTEXT_CHOICES.industry.length, 14);
|
|
105
|
+
assert.equal(CONTEXT_CHOICES.industry.at(-1)?.id, 'universal');
|
|
106
|
+
const names = CONTEXT_CHOICES.industry.slice(0, -1).map((c) => c.label.toLowerCase());
|
|
107
|
+
assert.deepEqual(names, [...names].sort((a, b) => a.localeCompare(b)));
|
|
108
|
+
assert.deepEqual(CONTEXT_CHOICES.ai_tier.map((c) => c.id), ['gen1', 'gen2', 'gen3']);
|
|
109
|
+
assert.equal(CONTEXT_CHOICES.function.length, 8);
|
|
110
|
+
const asked = assessInitiative({ proposal: 'We want to use AI to improve an internal process.' });
|
|
111
|
+
assert.deepEqual(asked.question?.choices, CONTEXT_CHOICES.industry);
|
|
112
|
+
});
|
|
113
|
+
test('every plain string is free of dashes, framework terms and banned vocabulary', () => {
|
|
114
|
+
const blobs = [GO_AHEAD_STEP];
|
|
115
|
+
for (const track of ['smaller_firm', 'enterprise']) {
|
|
116
|
+
blobs.push(...Object.values(QUESTION_WHY[track]), ...Object.values(QUESTION_SHORT[track]), ...Object.values(FIRST_STEP[track]));
|
|
117
|
+
for (const part of Object.values(WORK_PART_WORDING[track]))
|
|
118
|
+
blobs.push(part.name, part.step);
|
|
119
|
+
}
|
|
120
|
+
const proposals = [firm, bank];
|
|
121
|
+
const choices = ['a', 'b', 'c', 'd'];
|
|
122
|
+
for (const proposal of proposals) {
|
|
123
|
+
for (const fr of choices)
|
|
124
|
+
for (const gr of choices) {
|
|
125
|
+
const r = assessInitiative({ proposal, ...ok, answers: { financial_return: fr, governance_risk: gr, strategic_alignment: 'c', change_enablement: 'b', work_architecture: 'b' } });
|
|
126
|
+
if (r.verdict)
|
|
127
|
+
blobs.push(r.verdict.summary, r.verdict.first_step, ...r.verdict.holding_back.flatMap((h) => [h.short, h.answer, h.needed]));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const text = blobs.join('\n');
|
|
131
|
+
assert.doesNotMatch(text, /[—–]/);
|
|
132
|
+
assert.doesNotMatch(text, /work architecture|pillar|governance risk|strategic alignment|change enablement|financial return|Accelerate/i);
|
|
133
|
+
for (const banned of ['boardroom', 'leverage', 'crucial', 'pivotal', 'seamless', 'utilize', 'unlock', 'robust', 'perhaps', 'maybe']) {
|
|
134
|
+
assert.ok(!text.toLowerCase().includes(banned), `banned word found: ${banned}`);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
test('a property company resolves, and two loose phrases no longer decide a field', () => {
|
|
138
|
+
assert.equal(mapToTaxonomy({ industry: 'A traditional property company with EUR 600m revenue wants automation for accounts payable.' }).industry?.resolved, 'real_estate');
|
|
139
|
+
assert.equal(assessInitiative({ proposal: 'We need help writing the general business case for AI in a bank.' }).resolved_inputs.industry, 'financial');
|
|
140
|
+
assert.equal(assessInitiative({ proposal: 'An oil and gas company wants AI agents to monitor offshore platform operations.' }).resolved_inputs.function, undefined);
|
|
141
|
+
});
|
|
142
|
+
test('when two answers stop it, every plain field names the cause the reason names', () => {
|
|
143
|
+
const v = assessInitiative({ proposal: firm, ...ok, scores: { financial_return: 10, governance_risk: 90, strategic_alignment: 70, change_enablement: 70 } }).verdict;
|
|
144
|
+
assert.equal(v.classification, 'Stop');
|
|
145
|
+
assert.match(v.reason, /Governance/);
|
|
146
|
+
assert.equal(v.holding_back[0].id, 'governance_risk');
|
|
147
|
+
assert.equal(v.summary, 'Stop. The risk is above the level where this can go ahead.');
|
|
148
|
+
assert.equal(v.first_step, FIRST_STEP.smaller_firm.governance_risk);
|
|
149
|
+
});
|
|
150
|
+
test('a go-ahead from supplied scores does not speak of answers nobody gave', () => {
|
|
151
|
+
const v = assessInitiative({
|
|
152
|
+
proposal: firm, ...ok,
|
|
153
|
+
scores: { financial_return: 70, governance_risk: 30, strategic_alignment: 70, change_enablement: 70 },
|
|
154
|
+
work_architecture: { workflow_redesigned: true, roles_redesigned: true, decision_rights_defined: true, measures_updated: true },
|
|
155
|
+
}).verdict;
|
|
156
|
+
assert.equal(v.classification, 'Accelerate');
|
|
157
|
+
assert.equal(v.summary, 'Go ahead. Every score clears the bar.');
|
|
158
|
+
});
|
|
159
|
+
test('the context choices handed to a caller are copies', () => {
|
|
160
|
+
const first = assessInitiative({ proposal: 'We want to use AI to improve an internal process.' });
|
|
161
|
+
first.question.choices.length = 0;
|
|
162
|
+
const second = assessInitiative({ proposal: 'We want to use AI to improve an internal process.' });
|
|
163
|
+
assert.ok(second.question.choices.length > 3);
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=plainResult.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plainResult.test.js","sourceRoot":"","sources":["../src/plainResult.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,GACpF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,IAAI,GAAG,yEAAyE,CAAC;AACvF,MAAM,IAAI,GAAG,0EAA0E,CAAC;AACxF,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/B,MAAM,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,EAAW,CAAC;AAEzH,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B,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE;QACrB,MAAM,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE;QACrG,iBAAiB,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE;KAChI,CAAC,CAAC,OAAQ,CAAC;IACZ,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,uCAAuC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC7D,MAAM,KAAK,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,mDAAmD,EAAE,CAAC,CAAC;IAClG,KAAK,CAAC,QAAS,CAAC,OAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,mDAAmD,EAAE,CAAC,CAAC;IACnG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAS,CAAC,OAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the proposal for words that contradict a favourable answer.
|
|
3
|
+
*
|
|
4
|
+
* The guided verdict rests on what the user answers. Without this check a
|
|
5
|
+
* user could describe an AI that acts with no human review, then tick the
|
|
6
|
+
* answer that says a named person checks its work, and be told to go ahead.
|
|
7
|
+
*
|
|
8
|
+
* The rules are fixed phrases, published here, matched on whole words. No
|
|
9
|
+
* model reads the text and nothing is inferred beyond the phrase itself.
|
|
10
|
+
* A contradiction never changes a score. It holds the verdict at Fix, quotes
|
|
11
|
+
* the words from the proposal beside the answer, and leaves the user to
|
|
12
|
+
* settle which one is true.
|
|
13
|
+
*/
|
|
14
|
+
import type { AssessQuestionId } from './types.js';
|
|
15
|
+
export interface ProposalRule {
|
|
16
|
+
/** Stable name, recorded in the audit when the rule fires. */
|
|
17
|
+
rule: string;
|
|
18
|
+
/** The question whose favourable answer the phrase contradicts. */
|
|
19
|
+
question: AssessQuestionId;
|
|
20
|
+
/** What the phrase says about the initiative, in plain words. */
|
|
21
|
+
says: string;
|
|
22
|
+
pattern: RegExp;
|
|
23
|
+
}
|
|
24
|
+
export interface ProposalFinding {
|
|
25
|
+
rule: string;
|
|
26
|
+
question: AssessQuestionId;
|
|
27
|
+
/** The words as written in the proposal. */
|
|
28
|
+
proposal_words: string;
|
|
29
|
+
says: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Each pattern is anchored on word boundaries and uses single optional
|
|
33
|
+
* spaces after the proposal's whitespace has been collapsed, so no pattern
|
|
34
|
+
* can backtrack polynomially on long runs of separators.
|
|
35
|
+
*/
|
|
36
|
+
export declare const PROPOSAL_RULES: ProposalRule[];
|
|
37
|
+
/**
|
|
38
|
+
* Returns at most one finding per question, the first phrase found in the
|
|
39
|
+
* proposal for that question. Input is capped before any matching.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readProposal(proposal: string): ProposalFinding[];
|
|
42
|
+
//# sourceMappingURL=proposalReading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposalReading.d.ts","sourceRoot":"","sources":["../src/proposalReading.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAKD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EA0BxC,CAAC;AAQF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,CAahE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const HUMAN = '(?:human|person|people|staff|manager|adviser|advisor|clinician|underwriter|agent|employee)';
|
|
2
|
+
const CHECK = '(?:review|reviews|reviewing|oversight|supervision|approval|approvals|sign[- ]off|checks?|checking|intervention|involvement|input)';
|
|
3
|
+
/**
|
|
4
|
+
* Each pattern is anchored on word boundaries and uses single optional
|
|
5
|
+
* spaces after the proposal's whitespace has been collapsed, so no pattern
|
|
6
|
+
* can backtrack polynomially on long runs of separators.
|
|
7
|
+
*/
|
|
8
|
+
export const PROPOSAL_RULES = [
|
|
9
|
+
{
|
|
10
|
+
rule: 'no_human_check', question: 'governance_risk',
|
|
11
|
+
says: 'nobody checks or can override the AI',
|
|
12
|
+
pattern: new RegExp(`\\b(?:without|with no|with zero|no) (?:any |a |further |manual )?(?:${HUMAN} )?(?:${CHECK})\\b|\\b(?:no|without a|without any) ${HUMAN}s? in the loop\\b|\\b(?:nobody|no one|no-one) (?:checks|reviews|approves|oversees|supervises|can override|can stop)\\b|\\b(?:unsupervised|unattended)\\b|\\bfully autonomous(?:ly)?\\b`, 'i'),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
rule: 'return_untested', question: 'financial_return',
|
|
16
|
+
says: 'the cost and return have not been worked out',
|
|
17
|
+
pattern: /\b(?:no|without a|without any) (?:business case|cost estimate|budget)\b|\b(?:roi|return|payback|savings?|costs?|benefits?) (?:is|are|remains?|still )?(?: ?(?:unknown|unclear|unproven|untested|uncertain|not yet known|not known|to be confirmed|tbc))\b|\b(?:have|has)(?: not|n't) (?:yet )?(?:costed|priced|measured|quantified|worked out the)\b|\bnot (?:yet )?(?:costed|quantified)\b|\b(?:do not|don't|does not|doesn't) (?:yet )?know (?:what|how much) it (?:will )?(?:costs?|saves?|returns?)\b/i,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
rule: 'no_named_result', question: 'strategic_alignment',
|
|
21
|
+
says: 'no result or target has been set',
|
|
22
|
+
pattern: /\b(?:no|without a|without any) (?:clear |specific |defined |agreed )?(?:goal|goals|target|targets|objective|objectives|kpi|kpis|success measure|success measures)\b|\b(?:not sure|unsure|unclear) (?:yet )?(?:what|which|how) (?:it|this) (?:will |would |should )?(?:improve|improves|change|changes|deliver|delivers|help|helps)\b|\b(?:to )?see what happens\b|\bbecause (?:our |the )?(?:competitors|everyone|everybody|others) (?:are|is|do|does|have|has)\b/i,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
rule: 'no_owner_or_time', question: 'change_enablement',
|
|
26
|
+
says: 'nobody owns the change, or nobody has time for it',
|
|
27
|
+
pattern: /\b(?:no|without a|without an|without any) (?:named |clear |dedicated )?(?:owner|sponsor|lead|project lead|change budget|training budget|training|time set aside)\b|\b(?:nobody|no one|no-one) (?:owns|is responsible for|leads|is leading|has time)\b|\bin (?:their|his|her|our|my) spare time\b|\b(?:on|at) the side of (?:their |his |her |our |my |the )?desks?\b|\bon top of (?:their|his|her|our|my) (?:day jobs?|normal jobs?|existing work|current workload)\b/i,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
rule: 'work_unchanged', question: 'work_architecture',
|
|
31
|
+
says: 'the work itself stays as it is today',
|
|
32
|
+
pattern: /\b(?:no|without any|without) (?:changes?|change) to (?:the |our |how |existing |current )*(?:process|processes|workflow|workflows|roles|way we work|ways of working|we work|team|teams)\b|\bwithout (?:changing|redesigning|touching) (?:the |our |how |existing |current |any )*(?:process|processes|workflow|workflows|roles|way we work|ways of working|we work|anything)\b|\b(?:bolt(?:ed)?[- ]on|drop[- ]in|plug(?:ged)? (?:it )?(?:straight )?into)\b|\b(?:existing|current) (?:process|processes|workflow|workflows) (?:stay|stays|remain|remains|will stay|will remain) (?:the same|unchanged|as (?:it is|they are))\b/i,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* A phrase negated earlier in the same clause ("never runs without human
|
|
37
|
+
* review", "not approved without sign-off") says the opposite, so it is skipped.
|
|
38
|
+
*/
|
|
39
|
+
const NEGATED_BEFORE = /\b(?:not|never|no longer|cannot|can't|won't|nothing|n't)\b[^.,;:!?]{0,24}$/i;
|
|
40
|
+
/**
|
|
41
|
+
* Returns at most one finding per question, the first phrase found in the
|
|
42
|
+
* proposal for that question. Input is capped before any matching.
|
|
43
|
+
*/
|
|
44
|
+
export function readProposal(proposal) {
|
|
45
|
+
const text = String(proposal ?? '').slice(0, 4000).replace(/\s+/g, ' ');
|
|
46
|
+
const findings = [];
|
|
47
|
+
for (const { rule, question, says, pattern } of PROPOSAL_RULES) {
|
|
48
|
+
const global = new RegExp(pattern.source, 'gi');
|
|
49
|
+
for (const match of text.matchAll(global)) {
|
|
50
|
+
const before = text.slice(Math.max(0, match.index - 32), match.index);
|
|
51
|
+
if (NEGATED_BEFORE.test(before))
|
|
52
|
+
continue;
|
|
53
|
+
findings.push({ rule, question, proposal_words: match[0].trim(), says });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return findings;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=proposalReading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposalReading.js","sourceRoot":"","sources":["../src/proposalReading.ts"],"names":[],"mappings":"AAiCA,MAAM,KAAK,GAAG,4FAA4F,CAAC;AAC3G,MAA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CAAC;QAChD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,KAAM,CAAC,CAAC;YACxE,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;gBAAE,SAAS;YAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;YACzE,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposalReading.test.d.ts","sourceRoot":"","sources":["../src/proposalReading.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { assessInitiative } from './assessInitiative.js';
|
|
4
|
+
import { PROPOSAL_RULES, readProposal } from './proposalReading.js';
|
|
5
|
+
const ALL_D = { financial_return: 'd', governance_risk: 'd', strategic_alignment: 'd', change_enablement: 'd', work_architecture: 'd' };
|
|
6
|
+
const ctx = { industry: 'financial', function: 'risk', ai_tier: 'gen3', employees: 3500, confirmed: true };
|
|
7
|
+
function verdictFor(proposal, answers = ALL_D) {
|
|
8
|
+
const r = assessInitiative({ proposal, ...ctx, answers: answers });
|
|
9
|
+
assert.equal(r.status, 'verdict');
|
|
10
|
+
return r.verdict;
|
|
11
|
+
}
|
|
12
|
+
test('a proposal that agrees with its answers still earns Accelerate', () => {
|
|
13
|
+
const v = verdictFor('Agents draft consumer loan decisions and an underwriter approves each one.');
|
|
14
|
+
assert.equal(v.classification, 'Accelerate');
|
|
15
|
+
assert.deepEqual(v.contradictions, []);
|
|
16
|
+
});
|
|
17
|
+
test('no human review in the proposal holds a best-answer verdict at Fix and quotes the words', () => {
|
|
18
|
+
const v = verdictFor('Autonomous agents approve consumer loans without human review.');
|
|
19
|
+
assert.equal(v.classification, 'Fix');
|
|
20
|
+
assert.equal(v.contradictions.length, 1);
|
|
21
|
+
assert.equal(v.contradictions[0].id, 'governance_risk');
|
|
22
|
+
assert.equal(v.contradictions[0].proposal_words, 'without human review');
|
|
23
|
+
assert.equal(v.holding_back[0].proposal_words, 'without human review');
|
|
24
|
+
assert.match(v.first_step, /Your proposal says "without human review"/);
|
|
25
|
+
assert.equal(v.reason, 'The proposal contradicts an answer the go-ahead rests on.');
|
|
26
|
+
assert.ok(v.audit.rules_fired.includes('contradiction:governance_risk'));
|
|
27
|
+
assert.ok(v.audit.rules_fired.includes('cap:Fix(contradiction)'));
|
|
28
|
+
assert.equal(v.scores_supplied.governance_risk, 15, 'a contradiction never changes a score');
|
|
29
|
+
});
|
|
30
|
+
test('a phrase counts only against a favourable answer', () => {
|
|
31
|
+
const answers = { ...ALL_D, governance_risk: 'b' };
|
|
32
|
+
const v = verdictFor('Autonomous agents approve consumer loans without human review.', answers);
|
|
33
|
+
assert.equal(v.classification, 'Fix');
|
|
34
|
+
assert.deepEqual(v.contradictions, [], 'the answer already agrees with the proposal');
|
|
35
|
+
assert.ok(v.audit.rules_fired.includes('proposal_read:no_human_check'));
|
|
36
|
+
});
|
|
37
|
+
test('a Stop stays a Stop and still lists the contradiction', () => {
|
|
38
|
+
const answers = { ...ALL_D, financial_return: 'a' };
|
|
39
|
+
const v = verdictFor('Agents approve loans with no oversight.', answers);
|
|
40
|
+
assert.equal(v.classification, 'Stop');
|
|
41
|
+
assert.equal(v.contradictions[0].id, 'governance_risk');
|
|
42
|
+
});
|
|
43
|
+
test('each published rule fires on its own wording and on nothing neutral', () => {
|
|
44
|
+
const cases = {
|
|
45
|
+
no_human_check: ['runs without human review', 'there is no human in the loop', 'nobody checks its output', 'it runs unsupervised', 'a fully autonomous agent', 'with no oversight'],
|
|
46
|
+
return_untested: ['there is no business case yet', 'the ROI is unclear', 'we have not costed it', "we don't know what it costs"],
|
|
47
|
+
no_named_result: ['we have no clear target', 'we will see what happens', 'because competitors are doing it', 'not sure what it will improve'],
|
|
48
|
+
no_owner_or_time: ['there is no owner', 'nobody owns it', 'the team does it in their spare time', 'on top of their day job'],
|
|
49
|
+
work_unchanged: ['with no changes to the process', 'without changing how we work', 'a bolt-on to the CRM', 'the existing process stays the same'],
|
|
50
|
+
};
|
|
51
|
+
assert.deepEqual(Object.keys(cases).sort(), PROPOSAL_RULES.map((r) => r.rule).sort());
|
|
52
|
+
for (const [rule, phrases] of Object.entries(cases)) {
|
|
53
|
+
for (const phrase of phrases) {
|
|
54
|
+
const found = readProposal(`A 400-person retailer wants a GenAI assistant and ${phrase}.`);
|
|
55
|
+
assert.ok(found.some((f) => f.rule === rule), `${rule} did not fire on: ${phrase}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const neutral = 'A 400-person retailer wants a GenAI assistant for customer service. A named manager reviews every reply, the cost case is checked by finance and the target is first-contact resolution.';
|
|
59
|
+
assert.deepEqual(readProposal(neutral), []);
|
|
60
|
+
});
|
|
61
|
+
test('a negated phrase is not read as a contradiction', () => {
|
|
62
|
+
assert.deepEqual(readProposal('The agent never runs without human review.'), []);
|
|
63
|
+
assert.deepEqual(readProposal('Loans are not approved without sign-off.'), []);
|
|
64
|
+
});
|
|
65
|
+
test('long hostile input is read in bounded time', () => {
|
|
66
|
+
const start = Date.now();
|
|
67
|
+
readProposal('without '.repeat(50000) + 'the '.repeat(50000) + ' '.repeat(100000));
|
|
68
|
+
assert.ok(Date.now() - start < 500);
|
|
69
|
+
});
|
|
70
|
+
test('contradiction text carries no em-dashes and no banned vocabulary', () => {
|
|
71
|
+
const v = verdictFor('Agents approve loans without human review, there is no business case, no clear target, nobody owns it and it is a bolt-on.');
|
|
72
|
+
assert.equal(v.contradictions.length, 5);
|
|
73
|
+
const blob = JSON.stringify([v.summary, v.first_step, v.holding_back, v.contradictions, v.reason, PROPOSAL_RULES.map((r) => r.says)]);
|
|
74
|
+
assert.ok(!blob.includes('—'), 'em-dash found');
|
|
75
|
+
for (const w of ['boardroom', 'leverage', 'crucial', 'pivotal', 'seamless', 'robust', 'unlock']) {
|
|
76
|
+
assert.ok(!blob.toLowerCase().includes(w), `banned word: ${w}`);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=proposalReading.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposalReading.test.js","sourceRoot":"","sources":["../src/proposalReading.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,EAAW,CAAC;AACjJ,MAAM,GAAG,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAW,CAAC;AAEpH,SAAS,UAAU,CAAC,QAAgB,EAAE,UAAkC,KAAK;IAC3E,MAAM,CAAC,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,OAAgB,EAAE,CAAC,CAAC;IAC5E,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,SAA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AAE,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -474,12 +474,50 @@ export interface AssessAnswer {
|
|
|
474
474
|
/** Absent for work_architecture, which is four checks and carries no score. */
|
|
475
475
|
score?: number;
|
|
476
476
|
}
|
|
477
|
+
/** One answer that keeps the initiative from a go-ahead. */
|
|
478
|
+
export interface AssessHoldingBack {
|
|
479
|
+
id: AssessQuestionId;
|
|
480
|
+
/** A short name for the question, for lists. */
|
|
481
|
+
short: string;
|
|
482
|
+
/** The question as it was asked. */
|
|
483
|
+
question: string;
|
|
484
|
+
/** What the user answered. */
|
|
485
|
+
answer: string;
|
|
486
|
+
/** What the answer has to become to clear the bar. */
|
|
487
|
+
needed: string;
|
|
488
|
+
/** Present when the proposal's own words contradict this answer: the words as written. */
|
|
489
|
+
proposal_words?: string;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Words in the proposal that contradict a favourable answer. A contradiction
|
|
493
|
+
* holds the verdict at Fix until the proposal and the answer agree.
|
|
494
|
+
*/
|
|
495
|
+
export interface AssessContradiction {
|
|
496
|
+
id: AssessQuestionId;
|
|
497
|
+
/** The published phrase rule that fired. */
|
|
498
|
+
rule: string;
|
|
499
|
+
/** The words as written in the proposal. */
|
|
500
|
+
proposal_words: string;
|
|
501
|
+
/** What those words say about the initiative. */
|
|
502
|
+
proposal_says: string;
|
|
503
|
+
/** What the user answered. */
|
|
504
|
+
answer: string;
|
|
505
|
+
}
|
|
477
506
|
/**
|
|
478
507
|
* The front-door verdict. It rests only on what the user supplied: no pillar
|
|
479
508
|
* is filled in by the engine and no euro figure is returned.
|
|
480
509
|
*/
|
|
481
510
|
export interface AssessVerdict {
|
|
482
511
|
classification: Classification;
|
|
512
|
+
/** The outcome in one or two plain sentences. A Stop quotes its cause. Show this to the user. */
|
|
513
|
+
summary: string;
|
|
514
|
+
/** The answers that keep the initiative from a go-ahead, most decisive first. Empty for Accelerate. */
|
|
515
|
+
holding_back: AssessHoldingBack[];
|
|
516
|
+
/** The one thing to do first. */
|
|
517
|
+
first_step: string;
|
|
518
|
+
/** Where the proposal's own words contradict a favourable answer. Empty when they agree. */
|
|
519
|
+
contradictions: AssessContradiction[];
|
|
520
|
+
/** The rule that produced the classification, in framework terms. */
|
|
483
521
|
reason: string;
|
|
484
522
|
/** The pillar scores the verdict rests on, from answers or supplied scores. Nothing here was estimated. */
|
|
485
523
|
scores_supplied: Partial<PillarScores>;
|