Prioritize SEC financials for 10-K/10-Q and keep other filings qualitative

This commit is contained in:
2026-03-01 00:37:47 -05:00
parent 953d7c0099
commit 2a5b548d89
11 changed files with 773 additions and 149 deletions

View File

@@ -35,6 +35,10 @@ describe('task processor extraction helpers', () => {
redFlags: ['Debt service burden is rising'],
followUpQuestions: ['Is margin guidance sustainable?'],
portfolioSignals: ['Monitor leverage trend'],
segmentSpecificData: ['Services segment outgrew hardware segment.'],
geographicRevenueBreakdown: ['EMEA revenue grew faster than Americas.'],
companySpecificData: ['Same-store sales increased 4.2%.'],
secApiCrossChecks: ['Revenue from SEC API aligns with filing narrative.'],
confidence: 0.72
});
@@ -52,6 +56,10 @@ describe('task processor extraction helpers', () => {
redFlags: [],
followUpQuestions: [],
portfolioSignals: [],
segmentSpecificData: [],
geographicRevenueBreakdown: [],
companySpecificData: [],
secApiCrossChecks: [],
confidence: 0.2,
extra: 'not-allowed'
});
@@ -66,6 +74,16 @@ describe('task processor extraction helpers', () => {
expect(fallback.summary).toContain('Deterministic extraction fallback');
expect(fallback.keyPoints.length).toBeGreaterThan(0);
expect(fallback.redFlags.length).toBeGreaterThan(0);
expect(fallback.segmentSpecificData.length).toBeGreaterThan(0);
expect(fallback.geographicRevenueBreakdown.length).toBeGreaterThan(0);
expect(fallback.companySpecificData.length).toBeGreaterThan(0);
expect(fallback.secApiCrossChecks.length).toBeGreaterThan(0);
expect(fallback.confidence).toBe(0.2);
});
it('treats only 10-K and 10-Q as financial metric filings', () => {
expect(__taskProcessorInternals.isFinancialMetricsForm('10-K')).toBe(true);
expect(__taskProcessorInternals.isFinancialMetricsForm('10-Q')).toBe(true);
expect(__taskProcessorInternals.isFinancialMetricsForm('8-K')).toBe(false);
});
});