@llm-dev-ops/agentics-cli 2.1.5 → 2.4.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/pipeline/auto-chain.d.ts +190 -0
- package/dist/pipeline/auto-chain.d.ts.map +1 -1
- package/dist/pipeline/auto-chain.js +1571 -72
- package/dist/pipeline/auto-chain.js.map +1 -1
- package/dist/pipeline/phase2/phases/prompt-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/prompt-generator.js +205 -12
- package/dist/pipeline/phase2/phases/prompt-generator.js.map +1 -1
- package/dist/pipeline/phase2/schemas.d.ts +10 -10
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts +12 -0
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.js +92 -25
- package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
- package/dist/pipeline/phase4-5-pre-render/financial-model.d.ts +51 -0
- package/dist/pipeline/phase4-5-pre-render/financial-model.d.ts.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/financial-model.js +118 -0
- package/dist/pipeline/phase4-5-pre-render/financial-model.js.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/post-render-reconciler.d.ts +53 -0
- package/dist/pipeline/phase4-5-pre-render/post-render-reconciler.d.ts.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/post-render-reconciler.js +130 -0
- package/dist/pipeline/phase4-5-pre-render/post-render-reconciler.js.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/pre-render-coordinator.d.ts +47 -0
- package/dist/pipeline/phase4-5-pre-render/pre-render-coordinator.d.ts.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/pre-render-coordinator.js +105 -0
- package/dist/pipeline/phase4-5-pre-render/pre-render-coordinator.js.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/sector-baselines.d.ts +42 -0
- package/dist/pipeline/phase4-5-pre-render/sector-baselines.d.ts.map +1 -0
- package/dist/pipeline/phase4-5-pre-render/sector-baselines.js +117 -0
- package/dist/pipeline/phase4-5-pre-render/sector-baselines.js.map +1 -0
- package/dist/pipeline/phase5-build/phase5-build-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase5-build/phase5-build-coordinator.js +44 -0
- package/dist/pipeline/phase5-build/phase5-build-coordinator.js.map +1 -1
- package/dist/pipeline/phase5-build/phases/post-generation-validator.d.ts +75 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.d.ts.map +1 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.js +1068 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.js.map +1 -0
- package/dist/pipeline/phase5-build/types.d.ts +1 -1
- package/dist/pipeline/phase5-build/types.d.ts.map +1 -1
- package/dist/pipeline/types.d.ts +87 -0
- package/dist/pipeline/types.d.ts.map +1 -1
- package/dist/pipeline/types.js +51 -1
- package/dist/pipeline/types.js.map +1 -1
- package/dist/synthesis/consensus-svg.d.ts +19 -0
- package/dist/synthesis/consensus-svg.d.ts.map +1 -0
- package/dist/synthesis/consensus-svg.js +95 -0
- package/dist/synthesis/consensus-svg.js.map +1 -0
- package/dist/synthesis/consensus-tiers.d.ts +99 -0
- package/dist/synthesis/consensus-tiers.d.ts.map +1 -0
- package/dist/synthesis/consensus-tiers.js +285 -0
- package/dist/synthesis/consensus-tiers.js.map +1 -0
- package/dist/synthesis/domain-labor-classifier.d.ts +101 -0
- package/dist/synthesis/domain-labor-classifier.d.ts.map +1 -0
- package/dist/synthesis/domain-labor-classifier.js +312 -0
- package/dist/synthesis/domain-labor-classifier.js.map +1 -0
- package/dist/synthesis/domain-unit-registry.d.ts +59 -0
- package/dist/synthesis/domain-unit-registry.d.ts.map +1 -0
- package/dist/synthesis/domain-unit-registry.js +320 -0
- package/dist/synthesis/domain-unit-registry.js.map +1 -0
- package/dist/synthesis/financial-claim-extractor.d.ts +72 -0
- package/dist/synthesis/financial-claim-extractor.d.ts.map +1 -0
- package/dist/synthesis/financial-claim-extractor.js +382 -0
- package/dist/synthesis/financial-claim-extractor.js.map +1 -0
- package/dist/synthesis/financial-consistency-rules.d.ts +70 -0
- package/dist/synthesis/financial-consistency-rules.d.ts.map +1 -0
- package/dist/synthesis/financial-consistency-rules.js +483 -0
- package/dist/synthesis/financial-consistency-rules.js.map +1 -0
- package/dist/synthesis/financial-consistency-runner.d.ts +73 -0
- package/dist/synthesis/financial-consistency-runner.d.ts.map +1 -0
- package/dist/synthesis/financial-consistency-runner.js +131 -0
- package/dist/synthesis/financial-consistency-runner.js.map +1 -0
- package/dist/synthesis/forbidden-spin-phrases.d.ts +32 -0
- package/dist/synthesis/forbidden-spin-phrases.d.ts.map +1 -0
- package/dist/synthesis/forbidden-spin-phrases.js +84 -0
- package/dist/synthesis/forbidden-spin-phrases.js.map +1 -0
- package/dist/synthesis/phase-gate-thresholds.d.ts +30 -0
- package/dist/synthesis/phase-gate-thresholds.d.ts.map +1 -0
- package/dist/synthesis/phase-gate-thresholds.js +34 -0
- package/dist/synthesis/phase-gate-thresholds.js.map +1 -0
- package/dist/synthesis/prompts/index.d.ts.map +1 -1
- package/dist/synthesis/prompts/index.js +22 -0
- package/dist/synthesis/prompts/index.js.map +1 -1
- package/dist/synthesis/roadmap-dates.d.ts +72 -0
- package/dist/synthesis/roadmap-dates.d.ts.map +1 -0
- package/dist/synthesis/roadmap-dates.js +203 -0
- package/dist/synthesis/roadmap-dates.js.map +1 -0
- package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.js +135 -1
- package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
- package/dist/synthesis/simulation-renderers.d.ts +105 -2
- package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
- package/dist/synthesis/simulation-renderers.js +1192 -123
- package/dist/synthesis/simulation-renderers.js.map +1 -1
- package/dist/synthesis/unit-economics-loader.d.ts +71 -0
- package/dist/synthesis/unit-economics-loader.d.ts.map +1 -0
- package/dist/synthesis/unit-economics-loader.js +200 -0
- package/dist/synthesis/unit-economics-loader.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-PIPELINE-066: Domain Unit Registry
|
|
3
|
+
*
|
|
4
|
+
* Maps a detected sector to its domain unit (the thing savings actually scale
|
|
5
|
+
* with) and a savings-base formula. Replaces per-employee heuristics whenever
|
|
6
|
+
* a sector in this registry is detected.
|
|
7
|
+
*
|
|
8
|
+
* Pure functions — no I/O.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The eight sectors called out in ADR-PIPELINE-066 §3.
|
|
12
|
+
* Order matters for classification — more specific patterns first.
|
|
13
|
+
*/
|
|
14
|
+
export const SECTOR_REGISTRY = [
|
|
15
|
+
{
|
|
16
|
+
sector: 'hospitality',
|
|
17
|
+
domainUnit: { label: 'occupied room night', abbrev: 'orn' },
|
|
18
|
+
scopeKeys: ['rooms', 'properties'],
|
|
19
|
+
savingsFormula: 'rooms × occupancy × $/occupied-room-night',
|
|
20
|
+
unitSavingsKey: 'usd_per_orn',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
sector: 'commercial-real-estate',
|
|
24
|
+
domainUnit: { label: 'square foot-year', abbrev: 'sqft-yr' },
|
|
25
|
+
scopeKeys: ['sqft', 'properties'],
|
|
26
|
+
savingsFormula: 'sqft × $/sqft-year',
|
|
27
|
+
unitSavingsKey: 'usd_per_sqft_year',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
sector: 'fleet',
|
|
31
|
+
domainUnit: { label: 'vehicle-mile', abbrev: 'vmi' },
|
|
32
|
+
scopeKeys: ['vehicles'],
|
|
33
|
+
savingsFormula: 'fleet × miles × $/mile',
|
|
34
|
+
unitSavingsKey: 'usd_per_vehicle_mile',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
sector: 'retail',
|
|
38
|
+
domainUnit: { label: 'transaction', abbrev: 'txn' },
|
|
39
|
+
scopeKeys: ['properties', 'units'],
|
|
40
|
+
savingsFormula: 'daily transactions × 365 × $/transaction',
|
|
41
|
+
unitSavingsKey: 'usd_per_transaction',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
sector: 'manufacturing',
|
|
45
|
+
domainUnit: { label: 'unit produced', abbrev: 'unit' },
|
|
46
|
+
scopeKeys: ['units'],
|
|
47
|
+
savingsFormula: 'throughput × $/unit',
|
|
48
|
+
unitSavingsKey: 'usd_per_unit_produced',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
sector: 'healthcare',
|
|
52
|
+
domainUnit: { label: 'patient-day', abbrev: 'pday' },
|
|
53
|
+
scopeKeys: ['beds'],
|
|
54
|
+
savingsFormula: 'census × $/patient-day',
|
|
55
|
+
unitSavingsKey: 'usd_per_patient_day',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
sector: 'data-center',
|
|
59
|
+
domainUnit: { label: 'kilowatt-hour', abbrev: 'kWh' },
|
|
60
|
+
scopeKeys: ['units'],
|
|
61
|
+
savingsFormula: 'load × 8760 × $/kWh',
|
|
62
|
+
unitSavingsKey: 'usd_per_kwh',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
sector: 'call-center',
|
|
66
|
+
domainUnit: { label: 'contact minute', abbrev: 'cmin' },
|
|
67
|
+
scopeKeys: ['agents'],
|
|
68
|
+
savingsFormula: 'agents × minutes × $/contact-minute',
|
|
69
|
+
unitSavingsKey: 'usd_per_contact_minute',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
sector: 'airline-catering',
|
|
73
|
+
domainUnit: { label: 'meal loaded', abbrev: 'meal' },
|
|
74
|
+
scopeKeys: ['units', 'properties'],
|
|
75
|
+
savingsFormula: 'meals × flights × 365 × $/meal-loaded',
|
|
76
|
+
unitSavingsKey: 'usd_per_meal_loaded',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
const REGISTRY_BY_SECTOR = new Map(SECTOR_REGISTRY.map(e => [e.sector, e]));
|
|
80
|
+
export function getSectorEntry(sector) {
|
|
81
|
+
return REGISTRY_BY_SECTOR.get(sector) ?? null;
|
|
82
|
+
}
|
|
83
|
+
// Hard patterns: unambiguous sector indicators that lock the classification.
|
|
84
|
+
// Order matters — airline-catering must be checked BEFORE hospitality because
|
|
85
|
+
// an airline-catering query ("in-flight catering", "meals") might otherwise
|
|
86
|
+
// match "catering" as hospitality-adjacent.
|
|
87
|
+
const HARD_RULES = [
|
|
88
|
+
{
|
|
89
|
+
sector: 'airline-catering',
|
|
90
|
+
patterns: [
|
|
91
|
+
/\bin[-\s]?flight\s+catering\b/i,
|
|
92
|
+
/\bairline\s+catering\b/i,
|
|
93
|
+
/\bflight\s+catering\b/i,
|
|
94
|
+
/\bmeal\s+planning\b/i,
|
|
95
|
+
/\bmeals?\s+(?:loaded|per\s+flight)\b/i,
|
|
96
|
+
/\bgalley\s+catering\b/i,
|
|
97
|
+
/\b(?:airline|carrier)\s+(?:meal|food|galley)\b/i,
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
sector: 'hospitality',
|
|
102
|
+
patterns: [
|
|
103
|
+
/\bhotel\b/i,
|
|
104
|
+
/\bhousekeep/i,
|
|
105
|
+
/\blodging\b/i,
|
|
106
|
+
/\bhospitality\b/i,
|
|
107
|
+
/\bresort\b/i,
|
|
108
|
+
/\broom\s*night/i,
|
|
109
|
+
/\boccupanc/i,
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
sector: 'commercial-real-estate',
|
|
114
|
+
patterns: [
|
|
115
|
+
/\bcommercial\s+real\s+estate\b/i,
|
|
116
|
+
/\boffice\s+portfolio\b/i,
|
|
117
|
+
/\bbuilding\s+portfolio\b/i,
|
|
118
|
+
/\bworkplace\s+(?:optim|utiliz)/i,
|
|
119
|
+
/\bsqft\b/i,
|
|
120
|
+
/\bsquare\s+f(?:oot|eet)\b/i,
|
|
121
|
+
/\bfacility\s+management\b/i,
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
sector: 'fleet',
|
|
126
|
+
patterns: [
|
|
127
|
+
/\bfleet\b/i,
|
|
128
|
+
/\b(?:truck|vehicle)\s+fleet\b/i,
|
|
129
|
+
/\bEV\s+transition\b/i,
|
|
130
|
+
/\bfleet\s+electrification\b/i,
|
|
131
|
+
/\btransportation\s+(?:cost|fuel)/i,
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
sector: 'retail',
|
|
136
|
+
patterns: [
|
|
137
|
+
/\bretail\s+chain\b/i,
|
|
138
|
+
/\bstores?\b/i,
|
|
139
|
+
/\bgrocery\b/i,
|
|
140
|
+
/\bpoint[-\s]?of[-\s]?sale\b/i,
|
|
141
|
+
/\bregister\s+throughput\b/i,
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
sector: 'manufacturing',
|
|
146
|
+
patterns: [
|
|
147
|
+
/\bmanufactur/i,
|
|
148
|
+
/\bfactory\b/i,
|
|
149
|
+
/\bproduction\s+line\b/i,
|
|
150
|
+
/\bassembly\s+line\b/i,
|
|
151
|
+
/\bOEE\b/i,
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
sector: 'healthcare',
|
|
156
|
+
patterns: [
|
|
157
|
+
/\bhospital\b/i,
|
|
158
|
+
/\bclinic\b/i,
|
|
159
|
+
/\bpatient\b/i,
|
|
160
|
+
/\bnurs(?:e|ing)\b/i,
|
|
161
|
+
/\bhealthcare\b/i,
|
|
162
|
+
/\bhealth\s*system\b/i,
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
sector: 'data-center',
|
|
167
|
+
patterns: [
|
|
168
|
+
/\bdata\s*center\b/i,
|
|
169
|
+
/\bdatacenter\b/i,
|
|
170
|
+
/\bPUE\b/i,
|
|
171
|
+
/\bserver\s+farm\b/i,
|
|
172
|
+
/\bcolocation\b/i,
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
sector: 'call-center',
|
|
177
|
+
patterns: [
|
|
178
|
+
/\bcall\s*center\b/i,
|
|
179
|
+
/\bcontact\s*center\b/i,
|
|
180
|
+
/\bBPO\b/i,
|
|
181
|
+
/\bagent\s+productivity\b/i,
|
|
182
|
+
/\bcustomer\s+service\s+center\b/i,
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
/**
|
|
187
|
+
* Classify a query into a sector from the registry, or 'unknown'.
|
|
188
|
+
* Prefers an explicit sector hint (from domain_analysis.sector) when provided.
|
|
189
|
+
*/
|
|
190
|
+
export function classifySector(query, sectorHint) {
|
|
191
|
+
if (sectorHint) {
|
|
192
|
+
const normalized = normalizeSectorHint(sectorHint);
|
|
193
|
+
if (normalized !== 'unknown')
|
|
194
|
+
return normalized;
|
|
195
|
+
}
|
|
196
|
+
for (const rule of HARD_RULES) {
|
|
197
|
+
if (rule.patterns.some(p => p.test(query)))
|
|
198
|
+
return rule.sector;
|
|
199
|
+
}
|
|
200
|
+
return 'unknown';
|
|
201
|
+
}
|
|
202
|
+
function normalizeSectorHint(hint) {
|
|
203
|
+
const h = hint.toLowerCase().trim();
|
|
204
|
+
// airline-catering checked BEFORE hospitality so "hotel catering" doesn't misclassify
|
|
205
|
+
if (/airline[-\s]catering|in[-\s]?flight|flight[-\s]catering|galley/.test(h))
|
|
206
|
+
return 'airline-catering';
|
|
207
|
+
if (/hospitality|hotel|lodging|resort/.test(h))
|
|
208
|
+
return 'hospitality';
|
|
209
|
+
if (/commercial[-\s]real[-\s]estate|cre\b|office|workplace|building/.test(h))
|
|
210
|
+
return 'commercial-real-estate';
|
|
211
|
+
if (/fleet|transportation|vehicle/.test(h))
|
|
212
|
+
return 'fleet';
|
|
213
|
+
if (/retail|store/.test(h))
|
|
214
|
+
return 'retail';
|
|
215
|
+
if (/manufactur|factory|production/.test(h))
|
|
216
|
+
return 'manufacturing';
|
|
217
|
+
if (/healthcare|hospital|clinic|patient/.test(h))
|
|
218
|
+
return 'healthcare';
|
|
219
|
+
if (/data[-\s]?center|datacenter/.test(h))
|
|
220
|
+
return 'data-center';
|
|
221
|
+
if (/call[-\s]?center|contact[-\s]?center|bpo/.test(h))
|
|
222
|
+
return 'call-center';
|
|
223
|
+
return 'unknown';
|
|
224
|
+
}
|
|
225
|
+
/** Extract employee count from free text. Used for context only. */
|
|
226
|
+
export function extractEmployeeCountFromText(query) {
|
|
227
|
+
const lower = query.toLowerCase();
|
|
228
|
+
let employees = 10000;
|
|
229
|
+
const empIdx = lower.indexOf('employees');
|
|
230
|
+
const staffIdx = lower.indexOf('staff');
|
|
231
|
+
const targetIdx = empIdx !== -1 ? empIdx : staffIdx;
|
|
232
|
+
if (targetIdx > 5) {
|
|
233
|
+
const before = query.substring(Math.max(0, targetIdx - 30), targetIdx).trim();
|
|
234
|
+
const words = before.split(/\s+/);
|
|
235
|
+
for (let i = words.length - 1; i >= 0; i--) {
|
|
236
|
+
const cleaned = (words[i] ?? '').replace(/,/g, '').replace(/approximately/i, '').trim();
|
|
237
|
+
const num = parseInt(cleaned, 10);
|
|
238
|
+
if (num > 100 && num < 10_000_000) {
|
|
239
|
+
employees = num;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return employees;
|
|
245
|
+
}
|
|
246
|
+
const UNIT_PATTERNS = [
|
|
247
|
+
{ pattern: /(\d[\d,]*)\s*(?:flights?|aircraft)/i, sector: 'airline-catering', unitLabel: 'flights', unitAbbrev: 'flights' },
|
|
248
|
+
{ pattern: /(\d[\d,]*)\s*(?:hotels?|properties|resorts?)/i, sector: 'hospitality', unitLabel: 'rooms', unitAbbrev: 'rooms' },
|
|
249
|
+
{ pattern: /(\d[\d,]*)\s*(?:rooms?)\b/i, sector: 'hospitality', unitLabel: 'rooms', unitAbbrev: 'rooms' },
|
|
250
|
+
{ pattern: /(\d[\d,]*)\s*(?:buildings?|offices?|sites?)/i, sector: 'commercial-real-estate', unitLabel: 'sqft', unitAbbrev: 'sqft' },
|
|
251
|
+
{ pattern: /(\d[\d,]*)\s*(?:vehicles?|trucks?|vans?|cars?)/i, sector: 'fleet', unitLabel: 'vehicles', unitAbbrev: 'vehicles' },
|
|
252
|
+
{ pattern: /(\d[\d,]*)\s*(?:stores?|locations?|outlets?|branches?)/i, sector: 'retail', unitLabel: 'stores', unitAbbrev: 'stores' },
|
|
253
|
+
{ pattern: /(\d[\d,]*)\s*(?:plants?|factor(?:y|ies))/i, sector: 'manufacturing', unitLabel: 'plants', unitAbbrev: 'plants' },
|
|
254
|
+
{ pattern: /(\d[\d,]*)\s*(?:beds?|patients?)/i, sector: 'healthcare', unitLabel: 'beds', unitAbbrev: 'beds' },
|
|
255
|
+
{ pattern: /(\d[\d,]*)\s*(?:agents?)/i, sector: 'call-center', unitLabel: 'agents', unitAbbrev: 'agents' },
|
|
256
|
+
];
|
|
257
|
+
/**
|
|
258
|
+
* ADR-PIPELINE-066 §4: Replace `extractEmployeeCount` with a richer shape that
|
|
259
|
+
* carries the operational unit *and* its source. Savings math that used to
|
|
260
|
+
* multiply `employees * ratio` must now multiply `operationalUnits * ratio`
|
|
261
|
+
* whenever `source !== 'default'`.
|
|
262
|
+
*/
|
|
263
|
+
export function extractDomainScale(query, sectorHint) {
|
|
264
|
+
const employees = extractEmployeeCountFromText(query);
|
|
265
|
+
const sector = classifySector(query, sectorHint);
|
|
266
|
+
// Prefer an explicit unit count in the query over sector-based fallback.
|
|
267
|
+
for (const rule of UNIT_PATTERNS) {
|
|
268
|
+
const match = query.match(rule.pattern);
|
|
269
|
+
if (match?.[1]) {
|
|
270
|
+
const count = parseInt(match[1].replace(/,/g, ''), 10);
|
|
271
|
+
if (count > 0) {
|
|
272
|
+
return {
|
|
273
|
+
employees,
|
|
274
|
+
operationalUnits: count,
|
|
275
|
+
unitLabel: rule.unitLabel,
|
|
276
|
+
unitAbbrev: rule.unitAbbrev,
|
|
277
|
+
sector: sector === 'unknown' ? rule.sector : sector,
|
|
278
|
+
source: 'query-regex',
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// Sector-based ratios when no explicit count was given. These are
|
|
284
|
+
// intentionally coarse — the goal is to produce a plausible operational
|
|
285
|
+
// unit count, NOT to compute savings. Savings come from unit-economics.json.
|
|
286
|
+
if (sector !== 'unknown') {
|
|
287
|
+
const entry = getSectorEntry(sector);
|
|
288
|
+
const primaryKey = entry?.scopeKeys[0] ?? 'units';
|
|
289
|
+
const ratios = {
|
|
290
|
+
rooms: 0.02, // ~1 room per 50 employees (hotel avg)
|
|
291
|
+
sqft: 200, // ~200 sqft per employee
|
|
292
|
+
vehicles: 0.05, // ~5% of workforce drives fleet
|
|
293
|
+
stores: 0.005, // ~1 store per 200 employees
|
|
294
|
+
plants: 0.001, // ~1 plant per 1000 employees
|
|
295
|
+
beds: 0.2, // ~1 bed per 5 staff
|
|
296
|
+
agents: 0.3, // ~30% of headcount
|
|
297
|
+
units: 0.1,
|
|
298
|
+
properties: 0.002,
|
|
299
|
+
};
|
|
300
|
+
const ratio = ratios[primaryKey] ?? 0.1;
|
|
301
|
+
const operationalUnits = Math.max(1, Math.round(employees * ratio));
|
|
302
|
+
return {
|
|
303
|
+
employees,
|
|
304
|
+
operationalUnits,
|
|
305
|
+
unitLabel: primaryKey,
|
|
306
|
+
unitAbbrev: primaryKey,
|
|
307
|
+
sector,
|
|
308
|
+
source: 'query-regex',
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
employees,
|
|
313
|
+
operationalUnits: employees,
|
|
314
|
+
unitLabel: 'employees',
|
|
315
|
+
unitAbbrev: 'emp',
|
|
316
|
+
sector: 'unknown',
|
|
317
|
+
source: 'default',
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=domain-unit-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-unit-registry.js","sourceRoot":"","sources":["../../src/synthesis/domain-unit-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8BH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC;IAC7D;QACE,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,KAAK,EAAE;QAC3D,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;QAClC,cAAc,EAAE,2CAA2C;QAC3D,cAAc,EAAE,aAAa;KAC9B;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,UAAU,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE;QAC5D,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;QACjC,cAAc,EAAE,oBAAoB;QACpC,cAAc,EAAE,mBAAmB;KACpC;IACD;QACE,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE;QACpD,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,cAAc,EAAE,wBAAwB;QACxC,cAAc,EAAE,sBAAsB;KACvC;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE;QACnD,SAAS,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC;QAClC,cAAc,EAAE,0CAA0C;QAC1D,cAAc,EAAE,qBAAqB;KACtC;IACD;QACE,MAAM,EAAE,eAAe;QACvB,UAAU,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE;QACtD,SAAS,EAAE,CAAC,OAAO,CAAC;QACpB,cAAc,EAAE,qBAAqB;QACrC,cAAc,EAAE,uBAAuB;KACxC;IACD;QACE,MAAM,EAAE,YAAY;QACpB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ACxC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC;QACpE,OAAO;YACL,SAAS;YACT,gBAAgB;YAChB,SAAS,EAAE,UAAU;YACrB,UAAU,EAAE,UAAU;YACtB,MAAM;YACN,MAAM,EAAE,aAAa;SACtB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS;QACT,gBAAgB,EAAE,SAAS;QAC3B,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-PIPELINE-067: Financial Claim Extractor
|
|
3
|
+
*
|
|
4
|
+
* Parses rendered executive markdown and returns a structured list of
|
|
5
|
+
* FinancialClaim records. Used by the cross-document consistency runner to
|
|
6
|
+
* compare dollar figures, timelines, and scope labels across documents.
|
|
7
|
+
*
|
|
8
|
+
* Pure functions. Regex-based — no LLM calls.
|
|
9
|
+
*
|
|
10
|
+
* Renderers can short-circuit extraction by emitting an HTML comment tag
|
|
11
|
+
* immediately before the figure:
|
|
12
|
+
*
|
|
13
|
+
* <!-- fcv:kind=investment scope=pilot -->
|
|
14
|
+
* **Pilot investment:** $1.0M–$1.4M
|
|
15
|
+
*/
|
|
16
|
+
export type FinancialClaimDocument = 'executive-summary' | 'decision-memo' | 'roadmap' | 'business-case' | 'risk-register' | 'financial-analysis' | 'unknown';
|
|
17
|
+
export type FinancialClaimKind = 'investment' | 'savings' | 'timeline' | 'headcount' | 'roi' | 'npv';
|
|
18
|
+
export type FinancialClaimScope = 'pilot' | 'phase-1' | 'phase-2' | 'phase-3' | 'full-program' | 'unscoped';
|
|
19
|
+
export type FinancialClaimUnit = 'USD' | 'weeks' | 'months' | 'years' | 'count' | 'percent';
|
|
20
|
+
export interface FinancialClaim {
|
|
21
|
+
readonly document: FinancialClaimDocument;
|
|
22
|
+
readonly section: string;
|
|
23
|
+
readonly kind: FinancialClaimKind;
|
|
24
|
+
readonly scope: FinancialClaimScope;
|
|
25
|
+
readonly rangeLow?: number;
|
|
26
|
+
readonly rangeHigh?: number;
|
|
27
|
+
readonly pointValue?: number;
|
|
28
|
+
readonly unit: FinancialClaimUnit;
|
|
29
|
+
readonly rawText: string;
|
|
30
|
+
readonly line: number;
|
|
31
|
+
/** True when the claim was pulled from an explicit fcv: HTML comment tag. */
|
|
32
|
+
readonly tagged: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* ADR-PIPELINE-073: when the tag carried a `doc=` field, this holds its
|
|
35
|
+
* value. FCR-012 fires when this disagrees with the enclosing document.
|
|
36
|
+
*/
|
|
37
|
+
readonly docTag?: FinancialClaimDocument;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ADR-PIPELINE-073: Documents that MUST carry authoritative fcv tags on
|
|
41
|
+
* every money figure. Untagged money figures in these docs fire FCR-011.
|
|
42
|
+
* Other documents (narrative memos, agent output) continue to use
|
|
43
|
+
* proximity-based scope detection as a fallback.
|
|
44
|
+
*/
|
|
45
|
+
export declare const EXPECTS_TAGS: ReadonlySet<FinancialClaimDocument>;
|
|
46
|
+
/**
|
|
47
|
+
* Parse a single currency token like "$1.2M", "$600K", "$1,200,000",
|
|
48
|
+
* "USD 1.2M", or "1.2 million dollars". Returns NaN when the input does not
|
|
49
|
+
* look like a currency amount.
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseCurrency(token: string): number;
|
|
52
|
+
/** ADR-PIPELINE-073: count fcv tags in a document body. */
|
|
53
|
+
export declare function countFcvTags(body: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* ADR-PIPELINE-073: emit an fcv HTML comment tag. Used by renderers.
|
|
56
|
+
* Exported here (not in simulation-renderers) so the extractor and the
|
|
57
|
+
* renderer speak the same grammar.
|
|
58
|
+
*/
|
|
59
|
+
export declare function fcvTag(kind: FinancialClaimKind, scope: FinancialClaimScope, doc: FinancialClaimDocument): string;
|
|
60
|
+
/**
|
|
61
|
+
* Extract FinancialClaim records from a markdown document. The document name
|
|
62
|
+
* is recorded on every claim and becomes the primary key for
|
|
63
|
+
* cross-document rule evaluation.
|
|
64
|
+
*
|
|
65
|
+
* Scoping heuristic:
|
|
66
|
+
* 1. If an HTML fcv: tag precedes the figure (same line or prior line),
|
|
67
|
+
* use its declared kind/scope verbatim.
|
|
68
|
+
* 2. Otherwise scan a ±60 char window around the figure for scope words
|
|
69
|
+
* ("pilot", "phase 1", "full program", ...).
|
|
70
|
+
*/
|
|
71
|
+
export declare function extractClaims(markdown: string, document: FinancialClaimDocument): FinancialClaim[];
|
|
72
|
+
//# sourceMappingURL=financial-claim-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"financial-claim-extractor.d.ts","sourceRoot":"","sources":["../../src/synthesis/financial-claim-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,sBAAsB,GAC9B,mBAAmB,GACnB,eAAe,GACf,SAAS,GACT,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,SAAS,CAAC;AAEd,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,SAAS,GACT,UAAU,GACV,WAAW,GACX,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,SAAS,GACT,SAAS,GACT,SAAS,GACT,cAAc,GACd,UAAU,CAAC;AAEf,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAE5F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,kB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