@aibvf/core 0.10.5 → 0.11.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.
@@ -0,0 +1,119 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { extractRevenueEur } from './extractRevenue.js';
4
+ test('extractRevenueEur reads common EUR business formats', () => {
5
+ assert.equal(extractRevenueEur('a EUR 300m retailer'), 300_000_000);
6
+ assert.equal(extractRevenueEur('turnover of 1.2 billion'), 1_200_000_000);
7
+ assert.equal(extractRevenueEur('300 million euro retailer'), 300_000_000);
8
+ });
9
+ test('revenue extraction separates company revenue from initiative costs and benefits', () => {
10
+ for (const proposal of [
11
+ 'A EUR 250k pilot for a retailer with EUR 300m annual revenue.',
12
+ 'Pilot EUR 250k; company annual revenue EUR 300m.',
13
+ 'Company revenue EUR 300 million; implementation costs EUR 250k.',
14
+ 'Project adds EUR 2m incremental revenue; company revenue is EUR 300m.',
15
+ 'Project revenue EUR 2m; company turnover EUR 300m.',
16
+ ]) {
17
+ assert.equal(extractRevenueEur(proposal), 300_000_000, proposal);
18
+ }
19
+ for (const proposal of [
20
+ 'Pilot cost EUR 250k; annual operating cost EUR 50k.',
21
+ 'Company revenue is undisclosed; project budget EUR 250k.',
22
+ 'We expect EUR 2m incremental revenue from the project.',
23
+ 'An investment of EUR 2m in a traditional retailer.',
24
+ 'Annual revenue USD 300m; project budget EUR 250k.',
25
+ 'Revenue 300 million dollars; a EUR 250k pilot.',
26
+ 'Company revenue 300m BRL.',
27
+ 'Company revenue 300m rupees.',
28
+ ]) {
29
+ assert.equal(extractRevenueEur(proposal), undefined, proposal);
30
+ }
31
+ });
32
+ test('conflicting amounts require clarification while repeated equivalent revenue resolves', () => {
33
+ for (const proposal of [
34
+ 'Annual revenue EUR 300m; annual revenue EUR 400m.',
35
+ 'Revenue EUR 300m in 2024 and EUR 350m in 2025.',
36
+ 'Revenue EUR 300m EUR 400m.',
37
+ 'An EUR 300m retailer and an EUR 400m bank.',
38
+ 'Revenue EUR 300m and an unexplained EUR 250k.',
39
+ 'Revenue EUR 300-400m.',
40
+ 'Revenue EUR 300m to EUR 400m.',
41
+ 'Revenue EUR 300m or 400m.',
42
+ ]) {
43
+ assert.equal(extractRevenueEur(proposal), undefined, proposal);
44
+ }
45
+ assert.equal(extractRevenueEur('Annual revenue EUR 300m, also reported as EUR 300,000,000.'), 300_000_000);
46
+ });
47
+ test('revenue extraction handles full scales, decimal commas and grouped EUR amounts', () => {
48
+ for (const [proposal, expected] of [
49
+ ['A EUR300m retailer.', 300_000_000],
50
+ ['Annual revenue EUR 1.5 billion.', 1_500_000_000],
51
+ ['Annual revenue EUR 1,5 million.', 1_500_000],
52
+ ['Annual revenue EUR 1,500,000.50.', 1_500_001],
53
+ ['Annual revenue EUR 1.500.000,50.', 1_500_001],
54
+ ['Annual revenue EUR 1 500 000.', 1_500_000],
55
+ ['Annual revenue EUR\u202f1\u202f500\u202f000.', 1_500_000],
56
+ ['Annual turnover: 2bn.', 2_000_000_000],
57
+ ['Annual turnover: EUR 250 thousand.', 250_000],
58
+ ['Annual revenue EUR 0.', 0],
59
+ ['Annual revenue EUR 300 measured.', 300],
60
+ ]) {
61
+ assert.equal(extractRevenueEur(proposal), expected, proposal);
62
+ }
63
+ for (const proposal of [
64
+ 'Annual revenue EUR 1,200 million.',
65
+ 'Annual revenue EUR 1,20,000.',
66
+ 'Annual revenue EUR 12 34 567.',
67
+ 'Annual revenue EUR 300m2.',
68
+ 'Annual revenue -EUR 300m.',
69
+ 'Annual revenue EUR 999999999999999999999 billion.',
70
+ ]) {
71
+ assert.equal(extractRevenueEur(proposal), undefined, proposal);
72
+ }
73
+ });
74
+ test('project-attributed revenue requires a separate company revenue answer', () => {
75
+ for (const proposal of [
76
+ "The pilot's revenue is EUR 2m.",
77
+ 'The pilot’s annual revenue is EUR 2m.',
78
+ "The project's annual turnover is EUR 2m.",
79
+ 'We expect revenue of EUR 2m from the project.',
80
+ 'Revenue EUR 2m attributable to this initiative.',
81
+ 'EUR 2m annual revenue generated by the pilot.',
82
+ ]) {
83
+ assert.equal(extractRevenueEur(proposal), undefined, proposal);
84
+ assert.equal(extractRevenueEur(proposal + ' Company annual revenue is EUR 300m.'), 300_000_000, proposal);
85
+ }
86
+ assert.equal(extractRevenueEur('A pilot for a retailer with company annual revenue EUR 300m.'), 300_000_000);
87
+ });
88
+ test('monthly and quarterly amounts require annual revenue clarification', () => {
89
+ for (const proposal of [
90
+ 'Company monthly revenue is EUR 2m.',
91
+ 'Quarterly company revenue: EUR 6m.',
92
+ 'Annual revenue EUR 2m monthly.',
93
+ 'Revenue EUR 2m per month.',
94
+ 'EUR 6m quarterly revenue.',
95
+ 'Revenue EUR 6m each quarter.',
96
+ 'Revenue EUR 2m/month.',
97
+ 'EUR 2m in monthly revenue.',
98
+ ]) {
99
+ assert.equal(extractRevenueEur(proposal), undefined, proposal);
100
+ assert.equal(extractRevenueEur(proposal + ' Company annual revenue is EUR 24m.'), 24_000_000, proposal);
101
+ }
102
+ });
103
+ test('foreign currency names are case-insensitive without rejecting ordinary connecting words', () => {
104
+ for (const currency of ['rupees', 'Rupees', 'RUPEES', 'Yen', 'Yuan', 'Renminbi', 'Pounds', 'Dollars']) {
105
+ assert.equal(extractRevenueEur('Company revenue 300m ' + currency + '.'), undefined, currency);
106
+ }
107
+ assert.equal(extractRevenueEur('Company annual revenue 300m and a pilot budget EUR 250k.'), 300_000_000);
108
+ });
109
+ const bank = 'A traditional bank with revenue of EUR 2bn wants autonomous agents in customer service.';
110
+ const retailer = 'A traditional retailer with EUR 300m revenue wants a GenAI assistant for customer service.';
111
+ const allFour = { strategic_alignment: 75, financial_return: 70, change_enablement: 70, governance_risk: 30 };
112
+ const ready = { workflow_redesigned: true, roles_redesigned: true, decision_rights_defined: true, measures_updated: true };
113
+ test('a project budget, two different years or an unlabelled spend never become company revenue', () => {
114
+ assert.equal(extractRevenueEur('A traditional retailer wants a GenAI assistant for customer service with a project budget of EUR 250k.'), undefined);
115
+ assert.equal(extractRevenueEur('A traditional retailer wants a GenAI assistant for customer service. Annual revenue EUR 300m in 2024 and EUR 350m in 2025.'), undefined);
116
+ assert.equal(extractRevenueEur('A traditional retailer wants a EUR 250k GenAI assistant for customer service. Its annual revenue is EUR 300m.'), undefined);
117
+ assert.equal(extractRevenueEur('A traditional retailer wants a GenAI assistant for customer service. Pilot cost EUR 250k; annual revenue EUR 300m.'), 300_000_000);
118
+ });
119
+ //# sourceMappingURL=extractRevenue.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractRevenue.test.js","sourceRoot":"","sources":["../src/extractRevenue.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,IAAI,CAAC,qDAAqD,EAAE,GAAG,EAAE;IAC/D,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,EAAE,WAAW,CAAC,CAAC;IACpE,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,EAAE,aAAa,CAAC,CAAC;IAC1E,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,EAAE,WAAW,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,iFAAiF,EAAE,GAAG,EAAE;IAC3F,KAAK,MAAM,QAAQ,IAAI;QACrB,+DAA+D;QAC/D,kDAAkD;QAClD,iEAAiE;QACjE,uEAAuE;QACvE,oDAAoD;KACrD,EAAE,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI;QACrB,qDAAqD;QACrD,0DAA0D;QAC1D,wDAAwD;QACxD,oDAAoD;QACp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AC,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The guided questions: at most five, each with four everyday answers and
3
+ * "I do not know yet". Every answer carries a fixed, published score, so a
4
+ * regular user never types a number and the engine never fills one in.
5
+ *
6
+ * Two wordings, one rule set. Organisations under 250 people get questions
7
+ * phrased for an owner; larger ones get questions phrased for an executive.
8
+ * The scores behind the answers, the thresholds and the work redesign gate
9
+ * are identical for both.
10
+ */
11
+ import type { AssessChoiceId, AssessQuestionId, AssessTrack, PillarScores, WorkArchitectureInput } from './types.js';
12
+ /** Organisations below this headcount get the smaller-firm wording. */
13
+ export declare const SMALLER_FIRM_BELOW = 250;
14
+ export declare const UNKNOWN_LABEL = "I do not know yet.";
15
+ /** The score each answer carries. governance_risk is inverted: higher means more risk. */
16
+ export declare const CHOICE_SCORES: Record<keyof PillarScores, Record<Exclude<AssessChoiceId, 'unknown'>, number>>;
17
+ /** The work redesign answers are cumulative: each one includes the one before. */
18
+ export declare const WORK_ARCHITECTURE_CHOICES: Record<Exclude<AssessChoiceId, 'unknown'>, Required<WorkArchitectureInput>>;
19
+ interface Wording {
20
+ question: string;
21
+ a: string;
22
+ b: string;
23
+ c: string;
24
+ d: string;
25
+ }
26
+ export declare const QUESTION_WHY: Record<AssessQuestionId, string>;
27
+ export declare const WORDING: Record<AssessTrack, Record<AssessQuestionId, Wording>>;
28
+ export declare function trackFor(employees: number): AssessTrack;
29
+ export {};
30
+ //# sourceMappingURL=guidedQuestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guidedQuestions.d.ts","sourceRoot":"","sources":["../src/guidedQuestions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,qBAAqB,EACnF,MAAM,YAAY,CAAC;AAEpB,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAElD,0FAA0F;AAC1F,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAKxG,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAKjH,CAAC;AAEF,UAAU,OAAO;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AAElF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAMzD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CA2E1E,CAAC;AAEF,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAEvD"}
@@ -0,0 +1,104 @@
1
+ /** Organisations below this headcount get the smaller-firm wording. */
2
+ export const SMALLER_FIRM_BELOW = 250;
3
+ export const UNKNOWN_LABEL = 'I do not know yet.';
4
+ /** The score each answer carries. governance_risk is inverted: higher means more risk. */
5
+ export const CHOICE_SCORES = {
6
+ financial_return: { a: 15, b: 40, c: 65, d: 85 },
7
+ governance_risk: { a: 80, b: 55, c: 35, d: 15 },
8
+ strategic_alignment: { a: 20, b: 45, c: 65, d: 85 },
9
+ change_enablement: { a: 20, b: 45, c: 65, d: 85 },
10
+ };
11
+ /** The work redesign answers are cumulative: each one includes the one before. */
12
+ export const WORK_ARCHITECTURE_CHOICES = {
13
+ a: { workflow_redesigned: false, roles_redesigned: false, decision_rights_defined: false, measures_updated: false },
14
+ b: { workflow_redesigned: true, roles_redesigned: false, decision_rights_defined: false, measures_updated: false },
15
+ c: { workflow_redesigned: true, roles_redesigned: true, decision_rights_defined: true, measures_updated: false },
16
+ d: { workflow_redesigned: true, roles_redesigned: true, decision_rights_defined: true, measures_updated: true },
17
+ };
18
+ export const QUESTION_WHY = {
19
+ financial_return: 'A return too thin for the scope stops the initiative on its own.',
20
+ governance_risk: 'Risk that nobody controls stops the initiative on its own.',
21
+ strategic_alignment: 'Accelerate needs a clear link to a result the organisation already tracks.',
22
+ change_enablement: 'Accelerate needs a named owner and funded change work.',
23
+ work_architecture: 'Accelerate needs the work redesigned around the AI, with all four parts shown.',
24
+ };
25
+ export const WORDING = {
26
+ enterprise: {
27
+ financial_return: {
28
+ question: 'What does it cost to build and run, and what does it return each year?',
29
+ a: 'It costs more than it returns.',
30
+ b: 'It roughly breaks even, or the return rests on assumptions nobody has tested.',
31
+ c: 'The return covers the cost within two years, on figures finance has checked.',
32
+ d: 'The return covers the cost within a year, on measured figures.',
33
+ },
34
+ governance_risk: {
35
+ question: 'What could go wrong, and who can stop or override the AI?',
36
+ a: 'It acts on customers, money or regulated decisions, and nobody can stop or override it.',
37
+ b: 'The risks are known, and no named person owns them.',
38
+ c: 'A named person owns the risks, checks its work and can override it.',
39
+ d: 'The controls are tested, a named person can stop it, and its actions are logged and reviewed.',
40
+ },
41
+ strategic_alignment: {
42
+ question: 'Which business result does this move, and by how much?',
43
+ a: 'No business result is named.',
44
+ b: 'A result is named, with no target.',
45
+ c: 'A result the organisation already tracks, with a target and a named executive owner.',
46
+ d: 'A board-level result, with a target, a named owner and a baseline measured today.',
47
+ },
48
+ change_enablement: {
49
+ question: 'Who owns the change, and are the time and budget for it funded?',
50
+ a: 'Nobody owns it.',
51
+ b: 'An owner is named, with no time or budget for the change work.',
52
+ c: 'An owner is named and the change work is funded.',
53
+ d: 'A senior sponsor is active, the owner is named, the change work is funded and the people affected are involved.',
54
+ },
55
+ work_architecture: {
56
+ question: 'What has been redesigned in the work itself before go-live?',
57
+ a: 'Nothing yet. The AI is added to the existing process.',
58
+ b: 'The workflow has been redesigned.',
59
+ c: 'The workflow, the affected roles, and the decision and override rights have been redesigned.',
60
+ d: 'All four: the workflow, the roles, the decision and override rights, and the measures people are judged on.',
61
+ },
62
+ },
63
+ smaller_firm: {
64
+ financial_return: {
65
+ question: 'What does it cost each month, and what does it save or earn?',
66
+ a: 'It costs more than it saves.',
67
+ b: 'About even, or we are estimating.',
68
+ c: 'It pays for itself within two years, on numbers we have checked.',
69
+ d: 'It pays for itself within a year, on numbers we have measured.',
70
+ },
71
+ governance_risk: {
72
+ question: 'What could go wrong, and who can step in?',
73
+ a: 'It deals with customers, money or personal data, and nobody checks it.',
74
+ b: 'We know the risks, and nobody is responsible for them.',
75
+ c: 'One named person is responsible, checks its work and can step in.',
76
+ d: 'It has been tested, one person can switch it off, and what it does is recorded and reviewed.',
77
+ },
78
+ strategic_alignment: {
79
+ question: 'What will be better in the business, and by how much?',
80
+ a: 'We have not said.',
81
+ b: 'We know what should improve, with no target.',
82
+ c: 'One number we already watch, with a target and someone responsible.',
83
+ d: 'The number that matters most to the business, with a target, someone responsible and the figure for today written down.',
84
+ },
85
+ change_enablement: {
86
+ question: 'Who makes this happen, and do they have the time?',
87
+ a: 'Nobody in particular.',
88
+ b: 'Someone is named, on top of their normal job.',
89
+ c: 'Someone is named and has time set aside.',
90
+ d: 'The owner backs it, someone is named with time set aside, and the people who will use it are involved.',
91
+ },
92
+ work_architecture: {
93
+ question: 'What changes in how the work gets done?',
94
+ a: 'Nothing yet. We are adding the AI to how we work today.',
95
+ b: 'We have rewritten the steps of the job.',
96
+ c: 'We have rewritten the steps, who does what, and who decides or overrides.',
97
+ d: 'All four: the steps, who does what, who decides, and how we judge good work.',
98
+ },
99
+ },
100
+ };
101
+ export function trackFor(employees) {
102
+ return employees < SMALLER_FIRM_BELOW ? 'smaller_firm' : 'enterprise';
103
+ }
104
+ //# sourceMappingURL=guidedQuestions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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C,CAAC,EAAE,mCAAmC;YACtC,CAAC,EAAE,kEAAkE;YACrE,CAAC,EAAE,gEAAgE;SACpE;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,2CAA2C;YACrD,CAAC,EAAE,wEAAwE;YAC3E,CAAC,EAAE,wDAAwD;YAC3D,CAAC,EAAE,mEAAmE;YACtE,CAAC,EAAE,8FAA8F;SAClG;QACD,mBAAmB,EAAE;YACnB,QAAQ,EAAE,uDAAuD;YACjE,CAAC,EAAE,mBAAmB;YACtB,CAAC,EAAE,8CAA8C;YACjD,CAAC,EAAE,qEAAqE;YACxE,CAAC,EAAE,yHAAyH;SAC7H;QACD,iBAAiB,EAAE;YACjB,QAAQ,EAAE,mDAAmD;YAC7D,CAAC,EAAE,uBAAuB;YAC1B,CAAC,EAAE,+CAA+C;YAClD,CAAC,EAAE,0CAA0C;YAC7C,CAAC,EAAE,wGAAwG;SAC5G;QACD,iBAAiB,EAAE;YACjB,QAAQ,EAAE,yCAAyC;YACnD,CAAC,EAAE,yDAAyD;YAC5D,CAAC,EAAE,yCAAyC;YAC5C,CAAC,EAAE,2EAA2E;YAC9E,CAAC,EAAE,8EAA8E;SAClF;KACF;CACF,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,SAAiB;IACxC,OAAO,SAAS,GAAG,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;AACxE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,8 @@ export { inferReadiness } from './inferReadiness.js';
6
6
  export { sequencePortfolio } from './sequencePortfolio.js';
7
7
  export { assemblePortfolio } from './assemblePortfolio.js';
8
8
  export { mapToTaxonomy } from './aliases.js';
9
- export { assessInitiative, extractRevenueEur } from './assessInitiative.js';
9
+ export { assessInitiative, extractEmployees, extractRevenueEur } from './assessInitiative.js';
10
+ export { CHOICE_SCORES, SMALLER_FIRM_BELOW, WORDING, WORK_ARCHITECTURE_CHOICES } from './guidedQuestions.js';
10
11
  export { assessWorkArchitecture } from './workArchitecture.js';
11
12
  export { buildAudit, CORE_VERSION } from './audit.js';
12
13
  export { bvfSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,KAAK,EACL,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAAE,cAAc,EAC/B,UAAU,EAAE,2BAA2B,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,GAC/F,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,aAAa,EAAE,QAAQ,EAAE,gBAAgB,GAC1C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvH,mBAAmB,YAAY,CAAC;AAEhC,eAAO,MAAM,WAAW,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,KAAK,EACL,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAAE,cAAc,EAC/B,UAAU,EAAE,2BAA2B,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,GAC/F,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,aAAa,EAAE,QAAQ,EAAE,gBAAgB,GAC1C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvH,mBAAmB,YAAY,CAAC;AAEhC,eAAO,MAAM,WAAW,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -6,7 +6,8 @@ export { inferReadiness } from './inferReadiness.js';
6
6
  export { sequencePortfolio } from './sequencePortfolio.js';
7
7
  export { assemblePortfolio } from './assemblePortfolio.js';
8
8
  export { mapToTaxonomy } from './aliases.js';
9
- export { assessInitiative, extractRevenueEur } from './assessInitiative.js';
9
+ export { assessInitiative, extractEmployees, extractRevenueEur } from './assessInitiative.js';
10
+ export { CHOICE_SCORES, SMALLER_FIRM_BELOW, WORDING, WORK_ARCHITECTURE_CHOICES } from './guidedQuestions.js';
10
11
  export { assessWorkArchitecture } from './workArchitecture.js';
11
12
  export { buildAudit, CORE_VERSION } from './audit.js';
12
13
  export { bvfSchema } from './schema.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,KAAK,EACL,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAAE,cAAc,EAC/B,UAAU,EAAE,2BAA2B,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,GAC/F,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,aAAa,EAAE,QAAQ,EAAE,gBAAgB,GAC1C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAA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Ae,CAAC;AAGvH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plainLanguage.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plainLanguage.test.d.ts","sourceRoot":"","sources":["../src/plainLanguage.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Plain-language reading set. Each proposal is written the way a regular
3
+ * user writes one. The reading must be right, or the field must stay open
4
+ * and become a question. A wrong reading is the failure this file exists
5
+ * to prevent: add a case here whenever a user reports one.
6
+ */
7
+ import test from 'node:test';
8
+ import assert from 'node:assert/strict';
9
+ import { assessInitiative } from './assessInitiative.js';
10
+ import { mapToTaxonomy } from './aliases.js';
11
+ const CASES = [
12
+ { "proposal": "We are a European retail bank with around 2 billion euros in revenue. We want to deploy autonomous agents in customer service to handle complaints end to end. We are quite hierarchical.", "resolved": { "industry": "financial", "function": "cx", "ai_tier": "gen3" } },
13
+ { "proposal": "We are a 40-person accountancy firm and we want to use AI to speed up our month-end bookkeeping for clients.", "resolved": { "industry": "professional", "function": "finance", "employees": 40, "track": "smaller_firm" } },
14
+ { "proposal": "Should we roll out Copilot to our sales team? We're a 15m euro IT services company.", "resolved": { "industry": "technology", "function": "sales", "ai_tier": "gen2" } },
15
+ { "proposal": "We are a 12 person MSP with revenue of EUR 1.8 million. We want an AI agent to triage helpdesk tickets. We are agile.", "resolved": { "industry": "technology", "function": "cx", "ai_tier": "gen3", "employees": 12, "track": "smaller_firm" } },
16
+ { "proposal": "Our hospital pharmacy wants to use a chatbot for staff rota questions. Revenue about €300m. Departments mostly work separately.", "resolved": { "industry": "healthcare", "ai_tier": "gen2" } },
17
+ { "proposal": "A company wants to use AI for invoicing.", "resolved": { "function": "finance" } },
18
+ { "proposal": "We sell laptops and want a chatbot on our website.", "resolved": { "ai_tier": "gen2" } },
19
+ { "proposal": "We want AI to help our people write better proposals.", "resolved": {} },
20
+ { "proposal": "Our contact centre agents spend too long on wrap-up notes. We want GenAI to draft them.", "resolved": { "function": "cx", "ai_tier": "gen2" } },
21
+ { "proposal": "A law firm with turnover of €8m wants Claude to draft first versions of contracts.", "resolved": { "industry": "professional", "ai_tier": "gen2" } },
22
+ { "proposal": "We are a software company selling to hospitals and want a copilot for our support team.", "resolved": { "function": "cx", "ai_tier": "gen2" }, "ambiguous": { "industry": ["healthcare", "technology"] } },
23
+ { "proposal": "We established a pilot last year using ChatGPT for marketing copy.", "resolved": { "function": "sales", "ai_tier": "gen2" } },
24
+ { "proposal": "Any ideas on using AI in a 30 person architecture practice?", "resolved": { "industry": "professional", "employees": 30, "track": "smaller_firm" } },
25
+ { "proposal": "We are a slow growing charity with revenue of £4m and want a chatbot for donor questions.", "resolved": { "industry": "nonprofit", "ai_tier": "gen2" } },
26
+ { "proposal": "Our factory wants predictive maintenance using machine learning.", "resolved": { "industry": "manufacturing" } },
27
+ { "proposal": "We have €15m in sales and want AI for accounts payable.", "resolved": {}, "ambiguous": { "function": ["finance", "sales"] } },
28
+ { "proposal": "A logistics company with EUR 80m revenue wants agentic AI for procurement. We are siloed.", "resolved": { "industry": "logistics", "function": "supply", "ai_tier": "gen3" } },
29
+ { "proposal": "We want to use technology to improve our product.", "resolved": {} },
30
+ { "proposal": "An insurer, €900m revenue, traditional, wants RPA for claims handling in customer service.", "resolved": { "industry": "financial", "function": "cx", "ai_tier": "gen1" } },
31
+ { "proposal": "Our council wants a chatbot to answer housing questions from residents.", "resolved": { "industry": "public_sector", "ai_tier": "gen2" } },
32
+ { "proposal": "A design agency of 9 people wants AI agents to run its social media.", "resolved": { "industry": "creative", "ai_tier": "gen3", "employees": 9, "track": "smaller_firm" } },
33
+ { "proposal": "We are a regional building society and want AI to check mortgage applications for fraud.", "resolved": { "industry": "financial", "function": "risk" } },
34
+ { "proposal": "Our university IT helpdesk wants an AI assistant for password resets.", "resolved": { "industry": "education", "function": "it", "ai_tier": "gen2" } },
35
+ { "proposal": "We run a chain of care homes and want AI to draft care notes.", "resolved": { "industry": "healthcare" } },
36
+ { "proposal": "A 200 million euro manufacturer wants an AI copilot for its engineers in R&D. Cross-functional teams.", "resolved": { "industry": "manufacturing", "function": "rd", "ai_tier": "gen2" } },
37
+ { "proposal": "We are a recruitment agency and want AI to screen CVs.", "resolved": { "industry": "professional" } },
38
+ { "proposal": "Our finance team wants to automate reconciliations with RPA. We are a retailer with revenue of EUR 450m, bureaucratic.", "resolved": { "industry": "retail", "function": "finance", "ai_tier": "gen1" } },
39
+ { "proposal": "A power company wants autonomous agents to manage grid maintenance schedules.", "resolved": { "industry": "energy", "ai_tier": "gen3" } },
40
+ { "proposal": "Our pilot budget is €250k for a GenAI assistant in HR. We are a bank.", "resolved": { "industry": "financial", "function": "hr", "ai_tier": "gen2" } },
41
+ { "proposal": "We are a tech startup, revenue €3m, want AI agents for lead generation.", "resolved": { "industry": "technology", "function": "sales", "ai_tier": "gen3" } },
42
+ { "proposal": "The business went bankrupt once, so we are careful. We want AI for stock forecasting in our warehouse.", "resolved": { "function": "supply" } },
43
+ { "proposal": "We want a healthy return from AI in our garden centre shops.", "resolved": {} },
44
+ { "proposal": "Our platform team wants to automate cloud cost reports.", "resolved": {} },
45
+ { "proposal": "We are a general contractor in construction, revenue of EUR 60m, and want AI to price tenders.", "resolved": { "industry": "real_estate" } },
46
+ { "proposal": "A school trust wants an AI assistant for teachers to plan lessons.", "resolved": { "ai_tier": "gen2" } },
47
+ { "proposal": "We are a marketing agency of 25 people, turnover €3.5m, and want GenAI to write first drafts for clients.", "resolved": { "industry": "creative", "ai_tier": "gen2", "employees": 25, "track": "smaller_firm" } },
48
+ { "proposal": "Our law firm wants autonomous agents to review contracts. Partners decide everything by committee.", "resolved": { "industry": "professional", "ai_tier": "gen3" } },
49
+ { "proposal": "We want an AI agent for our estate agency to book viewings.", "resolved": { "industry": "real_estate", "ai_tier": "gen3" } },
50
+ { "proposal": "An NGO wants to use AI to translate field reports.", "resolved": { "industry": "nonprofit" } },
51
+ { "proposal": "A 500 million euro insurer wants GenAI in claims. Hierarchical.", "resolved": { "industry": "financial", "ai_tier": "gen2" } },
52
+ { "proposal": "We are a dental clinic with 14 staff and want AI to handle appointment calls.", "resolved": { "industry": "healthcare", "employees": 14, "track": "smaller_firm" } },
53
+ { "proposal": "Our IT department wants Copilot for all 600 staff. We are a housing association with revenue of €95m.", "resolved": { "industry": "real_estate", "function": "it", "ai_tier": "gen2", "employees": 600, "track": "enterprise" } },
54
+ { "proposal": "We are a telecom with EUR 4bn revenue and want agentic AI in the call centre. Siloed.", "resolved": { "industry": "technology", "function": "cx", "ai_tier": "gen3" } },
55
+ { "proposal": "Our growth has stalled. We are a SaaS company with ARR of €6m and want AI in customer support.", "resolved": { "industry": "technology", "function": "cx" } },
56
+ { "proposal": "We are a family-run haulage firm, 60 drivers, and want AI to plan routes.", "resolved": { "industry": "logistics" } },
57
+ { "proposal": "A pharma company wants generative AI to speed up regulatory submissions. Revenue €12bn. Matrix organisation.", "resolved": { "industry": "healthcare", "function": "risk", "ai_tier": "gen2" } },
58
+ ];
59
+ test('every plain-language proposal is read correctly or left open as a question', () => {
60
+ assert.ok(CASES.length >= 40);
61
+ for (const c of CASES) {
62
+ const r = assessInitiative({ proposal: c.proposal });
63
+ assert.deepEqual(r.resolved_inputs, c.resolved, c.proposal);
64
+ assert.deepEqual(r.ambiguous_fields ?? {}, c.ambiguous ?? {}, c.proposal);
65
+ assert.equal(r.status, r.missing_fields.length ? 'needs_input' : 'needs_confirmation', c.proposal);
66
+ }
67
+ });
68
+ test('a word never matches inside another word', () => {
69
+ assert.equal(mapToTaxonomy({ industry: 'a company' }).industry?.resolved, null);
70
+ assert.equal(mapToTaxonomy({ function: 'laptops' }).function?.resolved, null);
71
+ assert.equal(mapToTaxonomy({ industry: 'we went bankrupt' }).industry?.resolved, null);
72
+ assert.equal(mapToTaxonomy({ industry: 'a healthy business' }).industry?.resolved, null);
73
+ });
74
+ test('the longest phrase wins, so a retail bank is a bank', () => {
75
+ const m = mapToTaxonomy({ industry: 'European retail bank' }).industry;
76
+ assert.equal(m?.resolved, 'financial');
77
+ assert.equal(m?.matched_on, 'retail bank');
78
+ });
79
+ test('wording that points two ways returns no value and names both candidates', () => {
80
+ const m = mapToTaxonomy({ industry: 'a software company selling to hospitals and clinics across Europe' }).industry;
81
+ assert.equal(m?.resolved, null);
82
+ assert.deepEqual(m?.candidates, ['healthcare', 'technology']);
83
+ });
84
+ test('ordinary words count as a short direct answer and never inside a long description', () => {
85
+ assert.equal(mapToTaxonomy({ function: 'people' }).function?.resolved, 'hr');
86
+ assert.equal(mapToTaxonomy({ function: 'we want AI to help our people write better proposals' }).function?.resolved, null);
87
+ assert.equal(mapToTaxonomy({ ai_tier: 'agents' }).ai_tier?.resolved, 'gen3');
88
+ assert.equal(mapToTaxonomy({ ai_tier: 'our contact centre agents spend too long on notes' }).ai_tier?.resolved, null);
89
+ });
90
+ test('a proposal padded with long runs of spaces is read in linear time', () => {
91
+ const padded = `A retailer wants a chatbot. ${`revenue${' '.repeat(20_000)}`.repeat(3)}x`;
92
+ const started = performance.now();
93
+ const r = assessInitiative({ proposal: padded });
94
+ assert.ok(performance.now() - started < 1_000);
95
+ assert.equal(r.resolved_inputs.industry, 'retail');
96
+ });
97
+ //# sourceMappingURL=plainLanguage.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plainLanguage.test.js","sourceRoot":"","sources":["../src/plainLanguage.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,MAAM,KAAK,GAAW;IACpB,EAAC,UAAU,EAAC,2LAA2L,EAAC,UAAU,EAAC,EAAC,UAAU,EAAC,WAAW,EAAC,UAAU,EAAC,IAAI,EAAC,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AQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7E,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,sDAAsD,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3H,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7E,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AACxH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mEAAmE,EAAE,GAAG,EAAE;IAC7E,MAAM,MAAM,GAAG,+BAA+B,UAAU,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAC1F,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC;IAC/C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -405,35 +405,135 @@ export interface SequenceResult {
405
405
  sequencing_principles: string[];
406
406
  audit: AuditRecord;
407
407
  }
408
- export type AssessField = 'industry' | 'revenue_eur' | 'function' | 'ai_tier' | 'readiness';
408
+ /** The context the front door needs before it can ask its questions. */
409
+ export type AssessField = 'industry' | 'function' | 'ai_tier' | 'employees';
410
+ /** Which wording the questions use. The rules are the same for both. */
411
+ export type AssessTrack = 'smaller_firm' | 'enterprise';
412
+ export type AssessQuestionId = keyof PillarScores | 'work_architecture';
413
+ /** a to d are the four everyday answers, weakest to strongest. unknown leaves the question open. */
414
+ export type AssessChoiceId = 'a' | 'b' | 'c' | 'd' | 'unknown';
415
+ export interface AssessContext {
416
+ industry?: Industry;
417
+ function?: FunctionId;
418
+ ai_tier?: AiTier;
419
+ /** Number of people in the organisation. */
420
+ employees?: number;
421
+ /** Set once employees is known: under 250 is smaller_firm. */
422
+ track?: AssessTrack;
423
+ }
409
424
  /** Plain-English front door for one proposed AI investment. */
410
425
  export interface AssessInitiativeInput {
411
426
  proposal: string;
412
427
  industry?: string;
413
- revenue_eur?: number;
414
428
  function?: string;
415
429
  ai_tier?: string;
416
- readiness?: string;
430
+ employees?: number;
431
+ /** True once the user has confirmed how the proposal was read. */
432
+ confirmed?: boolean;
433
+ /** The user's answers to the guided questions, by question id. */
434
+ answers?: Partial<Record<AssessQuestionId, AssessChoiceId>>;
435
+ /** For callers that already hold 0 to 100 pillar scores. A supplied score takes precedence over an answer. */
417
436
  scores?: Partial<PillarScores>;
418
437
  signal_completeness?: number;
419
438
  work_architecture?: WorkArchitectureInput;
439
+ /** Accepted for compatibility and ignored: the front door verdict does not use revenue. */
440
+ revenue_eur?: number;
441
+ /** Accepted for compatibility and ignored: the front door verdict does not use the operating-model label. */
442
+ readiness?: string;
420
443
  }
421
- /** Either the next question needed to score, or the deterministic verdict. */
444
+ export interface AssessChoice {
445
+ id: string;
446
+ label: string;
447
+ }
448
+ /** The one thing to ask the user next, with its answer choices where there are any. */
449
+ export interface AssessQuestion {
450
+ id: AssessField | AssessQuestionId | 'confirmation';
451
+ question: string;
452
+ why?: string;
453
+ choices?: AssessChoice[];
454
+ /** The input field that carries the answer on the next call. */
455
+ answer_in: string;
456
+ /** Guided questions only: position in the sequence. */
457
+ number?: number;
458
+ of_at_most?: number;
459
+ }
460
+ /** One thing the user has to answer before the initiative can be judged. */
461
+ export interface AssessDecider {
462
+ id: AssessQuestionId;
463
+ /** The question in everyday words. */
464
+ question: string;
465
+ /** Why the answer decides the outcome. */
466
+ why: string;
467
+ /** The input field that carries the answer on the next call. */
468
+ answer_in: string;
469
+ }
470
+ /** What the user answered, with the published score the answer carries. */
471
+ export interface AssessAnswer {
472
+ choice: Exclude<AssessChoiceId, 'unknown'>;
473
+ label: string;
474
+ /** Absent for work_architecture, which is four checks and carries no score. */
475
+ score?: number;
476
+ }
477
+ /**
478
+ * The front-door verdict. It rests only on what the user supplied: no pillar
479
+ * is filled in by the engine and no euro figure is returned.
480
+ */
481
+ export interface AssessVerdict {
482
+ classification: Classification;
483
+ reason: string;
484
+ /** The pillar scores the verdict rests on, from answers or supplied scores. Nothing here was estimated. */
485
+ scores_supplied: Partial<PillarScores>;
486
+ /** The guided answers behind those scores, where the user answered a question. */
487
+ answers_given: Partial<Record<AssessQuestionId, AssessAnswer>>;
488
+ /** Present only when all four pillars were supplied. */
489
+ confidence?: number;
490
+ /** Present only when all four pillars were supplied. */
491
+ verdict_flips?: string[];
492
+ work_architecture: WorkArchitectureAssessment;
493
+ audit: AuditRecord;
494
+ /** Why no euro figure is given. */
495
+ value_note: string;
496
+ }
497
+ /**
498
+ * needs_input: a piece of context is unresolved, ask question.
499
+ * needs_confirmation: the context was read from the wording; the user confirms or corrects it.
500
+ * not_enough_to_judge: the user has not yet supplied what a verdict rests on; question is the next one to ask.
501
+ * verdict: Accelerate, Fix or Stop, from the user's answers only.
502
+ */
422
503
  export interface AssessInitiativeResult {
423
- status: 'needs_input' | 'verdict';
504
+ status: 'needs_input' | 'needs_confirmation' | 'not_enough_to_judge' | 'verdict';
424
505
  proposal: string;
425
- resolved_inputs: Partial<ScoreInput>;
506
+ resolved_inputs: AssessContext;
426
507
  resolutions: string[];
427
508
  missing_fields: AssessField[];
509
+ /** The next thing to ask, as one sentence. Absent when status is verdict. */
428
510
  next_question?: string;
511
+ /** The same question in structured form, with its answer choices. */
512
+ question?: AssessQuestion;
429
513
  suggestions?: string[];
430
- verdict?: ScoreResult;
514
+ /** Fields whose wording pointed to more than one value, with the competing values. */
515
+ ambiguous_fields?: Partial<Record<AssessField, string[]>>;
516
+ /** Fields read from the wording of the proposal instead of an explicit answer. */
517
+ inferred_fields: AssessField[];
518
+ /** Plain statement of how the proposal was read, for the user to correct. */
519
+ understood: string;
520
+ /** not_enough_to_judge only: up to three things still to answer, most decisive first. */
521
+ decides?: AssessDecider[];
522
+ /** not_enough_to_judge only: anything else still open after the three in decides. */
523
+ also_open?: AssessQuestionId[];
524
+ /** Questions the user answered with "I do not know yet". A verdict waits on these. */
525
+ to_find_out?: AssessDecider[];
526
+ /** Present when the context carries a condition the user must meet first. */
527
+ warning?: string;
528
+ verdict?: AssessVerdict;
431
529
  }
432
530
  /** Result of mapping free text onto the canonical taxonomy. */
433
531
  export interface TaxonomyMatch {
434
532
  input: string;
435
533
  resolved: string | null;
436
534
  matched_on?: string;
535
+ /** Present when the wording pointed to more than one value: the competing values. */
536
+ candidates?: string[];
437
537
  suggestions?: string[];
438
538
  }
439
539
  export interface MapTaxonomyResult {