euparliamentmonitor 0.8.19 → 0.8.21
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/package.json +7 -7
- package/scripts/constants/language-articles.d.ts +4 -0
- package/scripts/constants/language-articles.js +20 -0
- package/scripts/constants/language-ui.d.ts +8 -8
- package/scripts/constants/language-ui.js +64 -64
- package/scripts/constants/languages.d.ts +2 -2
- package/scripts/constants/languages.js +2 -2
- package/scripts/generators/news-enhanced.js +13 -3
- package/scripts/generators/pipeline/analysis-classification.d.ts +49 -0
- package/scripts/generators/pipeline/analysis-classification.js +333 -0
- package/scripts/generators/pipeline/analysis-existing.d.ts +67 -0
- package/scripts/generators/pipeline/analysis-existing.js +547 -0
- package/scripts/generators/pipeline/analysis-helpers.d.ts +140 -0
- package/scripts/generators/pipeline/analysis-helpers.js +266 -0
- package/scripts/generators/pipeline/analysis-risk.d.ts +49 -0
- package/scripts/generators/pipeline/analysis-risk.js +417 -0
- package/scripts/generators/pipeline/analysis-stage.d.ts +19 -39
- package/scripts/generators/pipeline/analysis-stage.js +219 -1704
- package/scripts/generators/pipeline/analysis-threats.d.ts +41 -0
- package/scripts/generators/pipeline/analysis-threats.js +142 -0
- package/scripts/generators/pipeline/fetch-stage.d.ts +25 -15
- package/scripts/generators/pipeline/fetch-stage.js +293 -117
- package/scripts/generators/strategies/article-strategy.d.ts +126 -7
- package/scripts/generators/strategies/article-strategy.js +491 -1
- package/scripts/generators/strategies/breaking-news-strategy.js +98 -8
- package/scripts/generators/strategies/committee-reports-strategy.js +23 -2
- package/scripts/generators/strategies/month-ahead-strategy.js +23 -2
- package/scripts/generators/strategies/monthly-review-strategy.js +13 -1
- package/scripts/generators/strategies/motions-strategy.js +15 -1
- package/scripts/generators/strategies/propositions-strategy.js +15 -1
- package/scripts/generators/strategies/week-ahead-strategy.js +19 -1
- package/scripts/generators/strategies/weekly-review-strategy.js +17 -1
- package/scripts/generators/synthesis-summary.d.ts +93 -0
- package/scripts/generators/synthesis-summary.js +364 -0
- package/scripts/index.d.ts +5 -2
- package/scripts/index.js +6 -1
- package/scripts/mcp/ep-mcp-client.d.ts +34 -1
- package/scripts/mcp/ep-mcp-client.js +110 -2
- package/scripts/mcp/mcp-connection.d.ts +3 -1
- package/scripts/mcp/mcp-connection.js +35 -4
- package/scripts/templates/article-template.js +24 -22
- package/scripts/templates/section-builders.js +2 -5
- package/scripts/types/index.d.ts +2 -1
- package/scripts/types/mcp.d.ts +7 -0
- package/scripts/types/political-classification.d.ts +1 -1
- package/scripts/types/quality.d.ts +9 -6
- package/scripts/types/significance.d.ts +130 -0
- package/scripts/types/significance.js +4 -0
- package/scripts/utils/article-quality-scorer.d.ts +13 -11
- package/scripts/utils/article-quality-scorer.js +36 -23
- package/scripts/utils/file-utils.d.ts +2 -2
- package/scripts/utils/file-utils.js +2 -2
- package/scripts/utils/html-sanitize.d.ts +10 -0
- package/scripts/utils/html-sanitize.js +32 -0
- package/scripts/utils/political-classification.d.ts +8 -7
- package/scripts/utils/political-classification.js +8 -7
- package/scripts/utils/political-risk-assessment.d.ts +1 -1
- package/scripts/utils/political-risk-assessment.js +1 -1
- package/scripts/utils/significance-scoring.d.ts +97 -0
- package/scripts/utils/significance-scoring.js +190 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024-2026 Hack23 AB
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* @module Generators/Pipeline/AnalysisClassification
|
|
5
|
+
* @description Classification analysis method builders for the analysis pipeline.
|
|
6
|
+
*
|
|
7
|
+
* Contains markdown builders for the **Classification** analysis method group:
|
|
8
|
+
* - `significance-classification` — political significance scoring
|
|
9
|
+
* - `impact-matrix` — multi-dimensional impact assessment
|
|
10
|
+
* - `actor-mapping` — political actor classification
|
|
11
|
+
* - `forces-analysis` — political forces balance analysis
|
|
12
|
+
* - `significance-scoring` — 5-dimension EP event significance scoring
|
|
13
|
+
*/
|
|
14
|
+
import { assessPoliticalSignificance, buildImpactMatrix, classifyPoliticalActors, analyzePoliticalForces, } from '../../utils/political-classification.js';
|
|
15
|
+
import { scoreSignificance, scoreBatch, formatBatchMarkdown, } from '../../utils/significance-scoring.js';
|
|
16
|
+
import { sanitizeCell, safeArr, toClassificationInput, buildMarkdownHeader, impactToNum, impactIndicator, highestImpactDimension, } from './analysis-helpers.js';
|
|
17
|
+
// ─── Heuristic scoring thresholds for EP event data ───────────────────────────
|
|
18
|
+
/** Event-count threshold above which parliamentary significance is elevated */
|
|
19
|
+
const EVENT_VOLUME_HIGH_THRESHOLD = 5;
|
|
20
|
+
/** Event-count threshold above which institutional relevance is elevated */
|
|
21
|
+
const EVENT_VOLUME_VERY_HIGH_THRESHOLD = 10;
|
|
22
|
+
/** Procedure-count threshold above which policy impact is elevated */
|
|
23
|
+
const PROCEDURE_VOLUME_THRESHOLD = 3;
|
|
24
|
+
/** Adopted-text-count threshold above which public interest is elevated */
|
|
25
|
+
const ADOPTED_TEXT_VOLUME_THRESHOLD = 2;
|
|
26
|
+
/** Base scores for EP event dimensions when data volume is high / low */
|
|
27
|
+
const EVENT_PARLIAMENTARY_HIGH = 6;
|
|
28
|
+
const EVENT_PARLIAMENTARY_LOW = 4;
|
|
29
|
+
const EVENT_POLICY_HIGH = 6;
|
|
30
|
+
const EVENT_POLICY_LOW = 3;
|
|
31
|
+
const EVENT_PUBLIC_HIGH = 5;
|
|
32
|
+
const EVENT_PUBLIC_LOW = 3;
|
|
33
|
+
/** Default temporal urgency for events (mid-range, adjusted at AI scoring) */
|
|
34
|
+
const EVENT_DEFAULT_URGENCY = 5;
|
|
35
|
+
const EVENT_INSTITUTIONAL_HIGH = 7;
|
|
36
|
+
const EVENT_INSTITUTIONAL_LOW = 4;
|
|
37
|
+
/** Default dimension scores for adopted texts (plenary-approved) */
|
|
38
|
+
const ADOPTED_PARLIAMENTARY = 7;
|
|
39
|
+
const ADOPTED_POLICY = 6;
|
|
40
|
+
const ADOPTED_PUBLIC = 5;
|
|
41
|
+
const ADOPTED_URGENCY = 4;
|
|
42
|
+
const ADOPTED_INSTITUTIONAL = 6;
|
|
43
|
+
/** Analysis method identifier for significance scoring */
|
|
44
|
+
export const METHOD_SIGNIFICANCE_SCORING_ID = 'significance-scoring';
|
|
45
|
+
// ─── Per-method markdown builders ────────────────────────────────────────────
|
|
46
|
+
/**
|
|
47
|
+
* Build markdown for the significance classification method.
|
|
48
|
+
* Scores and ranks legislative items by political significance.
|
|
49
|
+
*
|
|
50
|
+
* @param fetchedData - Raw fetched EP data
|
|
51
|
+
* @param date - Analysis date
|
|
52
|
+
* @returns Markdown content string
|
|
53
|
+
*/
|
|
54
|
+
export function buildSignificanceClassificationMarkdown(fetchedData, date) {
|
|
55
|
+
const input = toClassificationInput(fetchedData);
|
|
56
|
+
const significance = assessPoliticalSignificance(input);
|
|
57
|
+
const events = safeArr(fetchedData, 'events');
|
|
58
|
+
const docs = safeArr(fetchedData, 'documents');
|
|
59
|
+
const procedures = safeArr(fetchedData, 'procedures');
|
|
60
|
+
const adoptedTexts = safeArr(fetchedData, 'adoptedTexts');
|
|
61
|
+
const header = buildMarkdownHeader('significance-classification', date, significance === 'routine' ? 'medium' : 'high');
|
|
62
|
+
const sigMap = {
|
|
63
|
+
historic: 0.95,
|
|
64
|
+
critical: 0.8,
|
|
65
|
+
significant: 0.65,
|
|
66
|
+
notable: 0.45,
|
|
67
|
+
routine: 0.25,
|
|
68
|
+
};
|
|
69
|
+
const sigScore = sigMap[significance] ?? 0.25;
|
|
70
|
+
return (header +
|
|
71
|
+
`# Political Significance Classification
|
|
72
|
+
|
|
73
|
+
## Overall Significance: **${significance.toUpperCase()}**
|
|
74
|
+
|
|
75
|
+
\`\`\`mermaid
|
|
76
|
+
quadrantChart
|
|
77
|
+
title Political Significance Assessment — ${date}
|
|
78
|
+
x-axis Low Volume --> High Volume
|
|
79
|
+
y-axis Low Impact --> High Impact
|
|
80
|
+
quadrant-1 Critical Watch
|
|
81
|
+
quadrant-2 Strategic Priority
|
|
82
|
+
quadrant-3 Monitor
|
|
83
|
+
quadrant-4 Routine Track
|
|
84
|
+
Current Assessment: [${sigScore.toFixed(2)}, ${sigScore.toFixed(2)}]
|
|
85
|
+
Events Signal: [${Math.min(events.length / 20, 0.95).toFixed(2)}, 0.60]
|
|
86
|
+
Documents Signal: [${Math.min(docs.length / 20, 0.95).toFixed(2)}, 0.55]
|
|
87
|
+
Procedures Signal: [${Math.min(procedures.length / 10, 0.95).toFixed(2)}, 0.75]
|
|
88
|
+
Adopted Texts: [${Math.min(adoptedTexts.length / 10, 0.95).toFixed(2)}, 0.85]
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
## 5-Signal Model Scores
|
|
92
|
+
|
|
93
|
+
| Signal | Raw Data | Score |
|
|
94
|
+
|--------|----------|-------|
|
|
95
|
+
| Volume | ${events.length} events, ${docs.length} documents | ${Math.min((events.length + docs.length) / 10, 5).toFixed(1)}/5 |
|
|
96
|
+
| Pipeline | ${procedures.length} procedures | ${Math.min(procedures.length / 5, 5).toFixed(1)}/5 |
|
|
97
|
+
| Output | ${adoptedTexts.length} adopted texts | ${Math.min(adoptedTexts.length / 5, 5).toFixed(1)}/5 |
|
|
98
|
+
| Anomalies | Pattern deviation detection | — |
|
|
99
|
+
| Coalition | Group alignment analysis | — |
|
|
100
|
+
|
|
101
|
+
## Data Summary
|
|
102
|
+
|
|
103
|
+
| Metric | Value |
|
|
104
|
+
|--------|-------|
|
|
105
|
+
| Computed significance | ${significance.toUpperCase()} |
|
|
106
|
+
| Total data points | ${events.length + docs.length + procedures.length + adoptedTexts.length} |
|
|
107
|
+
| Events | ${events.length} |
|
|
108
|
+
| Documents | ${docs.length} |
|
|
109
|
+
| Procedures | ${procedures.length} |
|
|
110
|
+
| Adopted texts | ${adoptedTexts.length} |
|
|
111
|
+
| Date | ${date} |
|
|
112
|
+
|
|
113
|
+
## Date: ${date}
|
|
114
|
+
`);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Build markdown for the impact matrix method.
|
|
118
|
+
*
|
|
119
|
+
* @param fetchedData - Raw fetched EP data
|
|
120
|
+
* @param date - Analysis date
|
|
121
|
+
* @returns Markdown content string
|
|
122
|
+
*/
|
|
123
|
+
export function buildImpactMatrixMarkdown(fetchedData, date) {
|
|
124
|
+
const input = toClassificationInput(fetchedData);
|
|
125
|
+
const matrix = buildImpactMatrix(input);
|
|
126
|
+
const header = buildMarkdownHeader('impact-matrix', date, 'medium');
|
|
127
|
+
return (header +
|
|
128
|
+
`# Political Impact Matrix
|
|
129
|
+
|
|
130
|
+
## Overall Significance: **${matrix.overallSignificance.toUpperCase()}**
|
|
131
|
+
|
|
132
|
+
\`\`\`mermaid
|
|
133
|
+
pie title Impact Distribution by Dimension — ${date}
|
|
134
|
+
"Legislative" : ${impactToNum(matrix.legislativeImpact)}
|
|
135
|
+
"Coalition" : ${impactToNum(matrix.coalitionImpact)}
|
|
136
|
+
"Public Opinion" : ${impactToNum(matrix.publicOpinionImpact)}
|
|
137
|
+
"Institutional" : ${impactToNum(matrix.institutionalImpact)}
|
|
138
|
+
"Economic" : ${impactToNum(matrix.economicImpact)}
|
|
139
|
+
\`\`\`
|
|
140
|
+
|
|
141
|
+
## Impact Dimensions
|
|
142
|
+
|
|
143
|
+
| Dimension | Level | Indicator | Numeric |
|
|
144
|
+
|-----------|-------|-----------|---------|
|
|
145
|
+
| Legislative | ${matrix.legislativeImpact} | ${impactIndicator(matrix.legislativeImpact)} | ${impactToNum(matrix.legislativeImpact)} |
|
|
146
|
+
| Coalition | ${matrix.coalitionImpact} | ${impactIndicator(matrix.coalitionImpact)} | ${impactToNum(matrix.coalitionImpact)} |
|
|
147
|
+
| Public Opinion | ${matrix.publicOpinionImpact} | ${impactIndicator(matrix.publicOpinionImpact)} | ${impactToNum(matrix.publicOpinionImpact)} |
|
|
148
|
+
| Institutional | ${matrix.institutionalImpact} | ${impactIndicator(matrix.institutionalImpact)} | ${impactToNum(matrix.institutionalImpact)} |
|
|
149
|
+
| Economic | ${matrix.economicImpact} | ${impactIndicator(matrix.economicImpact)} | ${impactToNum(matrix.economicImpact)} |
|
|
150
|
+
|
|
151
|
+
## Summary
|
|
152
|
+
|
|
153
|
+
| Metric | Value |
|
|
154
|
+
|--------|-------|
|
|
155
|
+
| Overall significance | ${matrix.overallSignificance.toUpperCase()} |
|
|
156
|
+
| Highest impact | ${highestImpactDimension(matrix)} |
|
|
157
|
+
| Date | ${date} |
|
|
158
|
+
|
|
159
|
+
## Date: ${date}
|
|
160
|
+
`);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Build markdown for the actor mapping method.
|
|
164
|
+
*
|
|
165
|
+
* @param fetchedData - Raw fetched EP data
|
|
166
|
+
* @param date - Analysis date
|
|
167
|
+
* @returns Markdown content string
|
|
168
|
+
*/
|
|
169
|
+
export function buildActorMappingMarkdown(fetchedData, date) {
|
|
170
|
+
const input = toClassificationInput(fetchedData);
|
|
171
|
+
const actors = classifyPoliticalActors(input);
|
|
172
|
+
const header = buildMarkdownHeader('actor-mapping', date, actors.length > 0 ? 'medium' : 'low');
|
|
173
|
+
const actorRows = actors.length > 0
|
|
174
|
+
? actors
|
|
175
|
+
.map((a) => `| ${sanitizeCell(a.name)} | ${sanitizeCell(a.actorType)} | ${sanitizeCell(String(a.influence))} | ${sanitizeCell(a.position)} | ${sanitizeCell(a.role)} |`)
|
|
176
|
+
.join('\n')
|
|
177
|
+
: '| — | — | — | — | — |';
|
|
178
|
+
const actorTypes = actors.length > 0 ? [...new Set(actors.map((a) => a.actorType))] : [];
|
|
179
|
+
const typeCounts = actorTypes.map((t) => ({
|
|
180
|
+
type: t,
|
|
181
|
+
count: actors.filter((a) => a.actorType === t).length,
|
|
182
|
+
}));
|
|
183
|
+
const mermaidPie = typeCounts.length > 0
|
|
184
|
+
? typeCounts.map((tc) => ` "${tc.type}" : ${tc.count}`).join('\n')
|
|
185
|
+
: ' "No actors classified" : 1';
|
|
186
|
+
return (header +
|
|
187
|
+
`# Political Actor Mapping
|
|
188
|
+
|
|
189
|
+
## Actors Identified: ${actors.length}
|
|
190
|
+
|
|
191
|
+
\`\`\`mermaid
|
|
192
|
+
pie title Actor Type Distribution — ${date}
|
|
193
|
+
${mermaidPie}
|
|
194
|
+
\`\`\`
|
|
195
|
+
|
|
196
|
+
## Actor Classification
|
|
197
|
+
|
|
198
|
+
| Actor | Type | Influence | Position | Role |
|
|
199
|
+
|-------|------|-----------|----------|------|
|
|
200
|
+
${actorRows}
|
|
201
|
+
|
|
202
|
+
## Type Counts
|
|
203
|
+
|
|
204
|
+
| Type | Count |
|
|
205
|
+
|------|-------|
|
|
206
|
+
${typeCounts.length > 0 ? typeCounts.map((tc) => `| ${tc.type} | ${tc.count} |`).join('\n') : '| — | 0 |'}
|
|
207
|
+
|
|
208
|
+
## Date: ${date}
|
|
209
|
+
`);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Build markdown for the political forces analysis method.
|
|
213
|
+
*
|
|
214
|
+
* @param fetchedData - Raw fetched EP data
|
|
215
|
+
* @param date - Analysis date
|
|
216
|
+
* @returns Markdown content string
|
|
217
|
+
*/
|
|
218
|
+
export function buildForcesAnalysisMarkdown(fetchedData, date) {
|
|
219
|
+
const input = toClassificationInput(fetchedData);
|
|
220
|
+
const forces = analyzePoliticalForces(input);
|
|
221
|
+
const header = buildMarkdownHeader('forces-analysis', date, 'medium');
|
|
222
|
+
const forceRow = (name, f) => `| ${sanitizeCell(name)} | ${sanitizeCell(f.trend)} | ${(f.strength * 100).toFixed(0)}% | ${f.keyActors.length > 0 ? sanitizeCell(f.keyActors.join(', ')) : '—'} | ${sanitizeCell(f.confidence)} |`;
|
|
223
|
+
const cp = Math.max(1, Math.min(99, Math.round(forces.coalitionPower.strength * 100)));
|
|
224
|
+
const op = Math.max(1, Math.min(99, Math.round(forces.oppositionPower.strength * 100)));
|
|
225
|
+
const ib = Math.max(1, Math.min(99, Math.round(forces.institutionalBarriers.strength * 100)));
|
|
226
|
+
const pp = Math.max(1, Math.min(99, Math.round(forces.publicPressure.strength * 100)));
|
|
227
|
+
const ei = Math.max(1, Math.min(99, Math.round(forces.externalInfluences.strength * 100)));
|
|
228
|
+
return (header +
|
|
229
|
+
`# Political Forces Analysis
|
|
230
|
+
|
|
231
|
+
\`\`\`mermaid
|
|
232
|
+
pie title Political Force Distribution — ${date}
|
|
233
|
+
"Coalition Power" : ${cp}
|
|
234
|
+
"Opposition Power" : ${op}
|
|
235
|
+
"Institutional Barriers" : ${ib}
|
|
236
|
+
"Public Pressure" : ${pp}
|
|
237
|
+
"External Influences" : ${ei}
|
|
238
|
+
\`\`\`
|
|
239
|
+
|
|
240
|
+
## Forces Data
|
|
241
|
+
|
|
242
|
+
| Force | Trend | Strength | Key Actors | Confidence |
|
|
243
|
+
|-------|-------|----------|------------|------------|
|
|
244
|
+
${forceRow('Coalition Power', forces.coalitionPower)}
|
|
245
|
+
${forceRow('Opposition Power', forces.oppositionPower)}
|
|
246
|
+
${forceRow('Institutional Barriers', forces.institutionalBarriers)}
|
|
247
|
+
${forceRow('Public Pressure', forces.publicPressure)}
|
|
248
|
+
${forceRow('External Influences', forces.externalInfluences)}
|
|
249
|
+
|
|
250
|
+
## Balance
|
|
251
|
+
|
|
252
|
+
| Metric | Value |
|
|
253
|
+
|--------|-------|
|
|
254
|
+
| Coalition vs Opposition | ${cp}% vs ${op}% |
|
|
255
|
+
| Dominant force | ${cp > op ? 'Coalition' : op > cp ? 'Opposition' : 'Balanced'} |
|
|
256
|
+
| Date | ${date} |
|
|
257
|
+
|
|
258
|
+
## Date: ${date}
|
|
259
|
+
`);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Build markdown for the significance-scoring method.
|
|
263
|
+
* Uses the 5-dimension scoring engine to score all EP events.
|
|
264
|
+
*
|
|
265
|
+
* @param fetchedData - Raw fetched EP data
|
|
266
|
+
* @param date - Analysis date
|
|
267
|
+
* @returns Markdown content string
|
|
268
|
+
*/
|
|
269
|
+
export function buildSignificanceScoringMarkdown(fetchedData, date) {
|
|
270
|
+
const events = safeArr(fetchedData, 'events');
|
|
271
|
+
const adoptedTexts = safeArr(fetchedData, 'adoptedTexts');
|
|
272
|
+
const procedures = safeArr(fetchedData, 'procedures');
|
|
273
|
+
const header = buildMarkdownHeader(METHOD_SIGNIFICANCE_SCORING_ID, date, 'medium');
|
|
274
|
+
const inputs = [
|
|
275
|
+
...events.map((e) => {
|
|
276
|
+
const ev = e;
|
|
277
|
+
return {
|
|
278
|
+
title: String(ev['title'] ?? ev['label'] ?? 'Unknown Event'),
|
|
279
|
+
reference: String(ev['id'] ?? ''),
|
|
280
|
+
parliamentarySignificance: Math.min(10, events.length > EVENT_VOLUME_HIGH_THRESHOLD
|
|
281
|
+
? EVENT_PARLIAMENTARY_HIGH
|
|
282
|
+
: EVENT_PARLIAMENTARY_LOW),
|
|
283
|
+
policyImpact: Math.min(10, procedures.length > PROCEDURE_VOLUME_THRESHOLD ? EVENT_POLICY_HIGH : EVENT_POLICY_LOW),
|
|
284
|
+
publicInterest: Math.min(10, adoptedTexts.length > ADOPTED_TEXT_VOLUME_THRESHOLD ? EVENT_PUBLIC_HIGH : EVENT_PUBLIC_LOW),
|
|
285
|
+
temporalUrgency: EVENT_DEFAULT_URGENCY,
|
|
286
|
+
institutionalRelevance: Math.min(10, events.length > EVENT_VOLUME_VERY_HIGH_THRESHOLD
|
|
287
|
+
? EVENT_INSTITUTIONAL_HIGH
|
|
288
|
+
: EVENT_INSTITUTIONAL_LOW),
|
|
289
|
+
};
|
|
290
|
+
}),
|
|
291
|
+
...adoptedTexts.map((t) => {
|
|
292
|
+
const at = t;
|
|
293
|
+
return {
|
|
294
|
+
title: String(at['title'] ?? at['label'] ?? 'Adopted Text'),
|
|
295
|
+
reference: String(at['id'] ?? ''),
|
|
296
|
+
parliamentarySignificance: ADOPTED_PARLIAMENTARY,
|
|
297
|
+
policyImpact: ADOPTED_POLICY,
|
|
298
|
+
publicInterest: ADOPTED_PUBLIC,
|
|
299
|
+
temporalUrgency: ADOPTED_URGENCY,
|
|
300
|
+
institutionalRelevance: ADOPTED_INSTITUTIONAL,
|
|
301
|
+
};
|
|
302
|
+
}),
|
|
303
|
+
];
|
|
304
|
+
if (inputs.length === 0) {
|
|
305
|
+
return `${header}# 📈 Significance Scoring — ${date}\n\nNo events or adopted texts available for scoring.\n`;
|
|
306
|
+
}
|
|
307
|
+
const batch = scoreBatch(inputs);
|
|
308
|
+
const alignedScores = inputs.map((input) => scoreSignificance(input));
|
|
309
|
+
const batchTable = formatBatchMarkdown(inputs, alignedScores);
|
|
310
|
+
return `${header}# 📈 Significance Scoring — ${date}
|
|
311
|
+
|
|
312
|
+
## Summary
|
|
313
|
+
|
|
314
|
+
| Decision | Count |
|
|
315
|
+
|----------|:-----:|
|
|
316
|
+
| 📰 Publish | ${batch.summary.publish} |
|
|
317
|
+
| 📋 Hold | ${batch.summary.hold} |
|
|
318
|
+
| 🗄️ Skip | ${batch.summary.skip} |
|
|
319
|
+
|
|
320
|
+
## Batch Scoring
|
|
321
|
+
|
|
322
|
+
${batchTable}
|
|
323
|
+
`;
|
|
324
|
+
}
|
|
325
|
+
/** All classification method builders keyed by their AnalysisMethod identifier */
|
|
326
|
+
export const CLASSIFICATION_BUILDERS = {
|
|
327
|
+
'significance-classification': buildSignificanceClassificationMarkdown,
|
|
328
|
+
'impact-matrix': buildImpactMatrixMarkdown,
|
|
329
|
+
'actor-mapping': buildActorMappingMarkdown,
|
|
330
|
+
'forces-analysis': buildForcesAnalysisMarkdown,
|
|
331
|
+
[METHOD_SIGNIFICANCE_SCORING_ID]: buildSignificanceScoringMarkdown,
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=analysis-classification.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { MarkdownBuilder } from './analysis-helpers.js';
|
|
2
|
+
import type { AnalysisMethod } from './analysis-stage.js';
|
|
3
|
+
/** Analysis method identifier for synthesis summary */
|
|
4
|
+
export declare const METHOD_SYNTHESIS_SUMMARY_ID: "synthesis-summary";
|
|
5
|
+
/** Analysis method identifier for per-document intelligence analysis */
|
|
6
|
+
export declare const METHOD_DOCUMENT_ANALYSIS: "document-analysis";
|
|
7
|
+
/**
|
|
8
|
+
* Build markdown for the deep multi-perspective analysis.
|
|
9
|
+
* Outputs raw data metrics per stakeholder group for AI agent enrichment.
|
|
10
|
+
*
|
|
11
|
+
* @param fetchedData - Raw fetched EP data
|
|
12
|
+
* @param date - Analysis date
|
|
13
|
+
* @returns Markdown content string
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildDeepAnalysisMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Build markdown for the stakeholder impact analysis.
|
|
18
|
+
*
|
|
19
|
+
* @param fetchedData - Raw fetched EP data
|
|
20
|
+
* @param date - Analysis date
|
|
21
|
+
* @returns Markdown content string
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildStakeholderAnalysisMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Build markdown for coalition cohesion analysis.
|
|
26
|
+
*
|
|
27
|
+
* @param fetchedData - Raw fetched EP data
|
|
28
|
+
* @param date - Analysis date
|
|
29
|
+
* @returns Markdown content string
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildCoalitionAnalysisMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Build markdown for voting pattern analysis.
|
|
34
|
+
*
|
|
35
|
+
* @param fetchedData - Raw fetched EP data
|
|
36
|
+
* @param date - Analysis date
|
|
37
|
+
* @returns Markdown content string
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildVotingPatternsMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Build markdown for cross-session intelligence analysis.
|
|
42
|
+
*
|
|
43
|
+
* @param fetchedData - Raw fetched EP data
|
|
44
|
+
* @param date - Analysis date
|
|
45
|
+
* @returns Markdown content string
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildCrossSessionIntelligenceMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Build markdown for the synthesis-summary method.
|
|
50
|
+
* Aggregates all per-file analyses into a synthesis summary.
|
|
51
|
+
*
|
|
52
|
+
* @param fetchedData - Raw fetched EP data (includes _dateOutputDir)
|
|
53
|
+
* @param date - Analysis date
|
|
54
|
+
* @returns Markdown content string
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildSynthesisSummaryMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Build per-document intelligence analysis index and files.
|
|
59
|
+
*
|
|
60
|
+
* @param fetchedData - Raw fetched EP data
|
|
61
|
+
* @param date - Analysis date
|
|
62
|
+
* @returns Markdown index content string
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildDocumentAnalysisMarkdown(fetchedData: Record<string, unknown>, date: string): string;
|
|
65
|
+
/** All existing analysis method builders keyed by their AnalysisMethod identifier */
|
|
66
|
+
export declare const EXISTING_BUILDERS: Readonly<Partial<Record<AnalysisMethod, MarkdownBuilder>>>;
|
|
67
|
+
//# sourceMappingURL=analysis-existing.d.ts.map
|