Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit d360a0e

Browse files
ernieambroseclaude
andcommitted
fix: revert team-summary to lightweight queries
buildFromSquad fetches full attachments for every ticket, causing timeouts on large squads. Revert to SUMMARY_FIELDS queries for speed. Enrichment/criticality data remains available through ticket_details, remediation_plan, and blast_radius. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7048aeb commit d360a0e

3 files changed

Lines changed: 27 additions & 43 deletions

File tree

skills/pita/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You have access to the PITA MCP server (Pantheon Intelligent Threat Analyzer) wh
3939

4040
### By Tool
4141

42-
**team_summary**: Present as a dashboard with tables for severity, SLA health, sources, and trend. Call out anything alarming (high breach rate, zero resolutions, spike in new tickets). When `riskIndicators` has non-zero counts, add a "Risk Indicators" row to the dashboard showing CISA KEV tickets, high EPSS tickets, and internet-exposed tickets. These are high-signal metrics for security/compliance audiences.
42+
**team_summary**: Present as a dashboard with tables for severity, SLA health, sources, and trend. Call out anything alarming (high breach rate, zero resolutions, spike in new tickets).
4343

4444
**sla_status**: Group breached and approaching separately. Highlight unassigned tickets. Note breachedClosed count as "X additional closed tickets breached SLA during this audit period."
4545

src/tools/team-summary.ts

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import type { JiraClient } from '../clients/jira.js';
44
import { SUMMARY_FIELDS, TREND_FIELDS } from '../clients/jira.js';
55
import type { TTSClient } from '../clients/tts.js';
6-
import type { TeamSummary } from '../types/index.js';
7-
import { buildFromSquad } from '../correlation/engine.js';
6+
import type { TeamSummary, JiraIssue } from '../types/index.js';
87

98
function baseFilter(scope: string, filterId: string): string {
109
return scope === 'audit' ? `filter = ${filterId}` : 'project = VUL';
@@ -20,12 +19,17 @@ export async function getTeamSummary(
2019
const base = baseFilter(scope, auditFilterId);
2120
const squadClause = squad ? ` AND "Squad" = "${squad}"` : '';
2221

23-
// Use correlation engine for open tickets (includes enrichment/criticality parsing)
24-
const { primaryTickets } = await buildFromSquad(jira, tts, squad, scope);
25-
22+
// Query open VUL tickets
23+
const openJql = `${base}${squadClause} AND status NOT IN (Done, Closed)`;
2624
// Query closed VUL tickets (for breached-but-closed SLA tracking)
2725
const closedJql = `${base}${squadClause} AND status IN (Done, Closed)`;
28-
const closedResponse = await jira.searchIssues(closedJql, Infinity, SUMMARY_FIELDS);
26+
27+
const [openResponse, closedResponse] = await Promise.all([
28+
jira.searchIssues(openJql, Infinity, SUMMARY_FIELDS),
29+
jira.searchIssues(closedJql, Infinity, SUMMARY_FIELDS),
30+
]);
31+
32+
const issues = openResponse.issues;
2933

3034
// Count by severity
3135
const bySeverity: Record<string, number> = {
@@ -36,8 +40,8 @@ export async function getTeamSummary(
3640
unprioritized: 0,
3741
};
3842

39-
for (const ticket of primaryTickets) {
40-
const severity = ticket.severity.toLowerCase() || 'unprioritized';
43+
for (const issue of issues) {
44+
const severity = issue.fields.customfield_12500?.value?.toLowerCase() || 'unprioritized';
4145
if (severity in bySeverity) {
4246
bySeverity[severity]++;
4347
} else {
@@ -47,22 +51,27 @@ export async function getTeamSummary(
4751

4852
// Count by source
4953
const sources = { ghas: 0, wiz: 0 };
50-
for (const ticket of primaryTickets) {
51-
if (ticket.source === 'ghas') {
54+
for (const issue of issues) {
55+
const summary = issue.fields.summary.toLowerCase();
56+
if (summary.includes('ghas') || summary.includes('dependabot')) {
5257
sources.ghas++;
53-
} else if (ticket.source === 'wiz' || ticket.source === 'wiz-issue') {
58+
} else if (summary.includes('wiz')) {
5459
sources.wiz++;
5560
}
5661
}
5762

58-
// SLA health from enriched tickets (already have SLA from correlation engine)
63+
// Get SLA status for open tickets
64+
const openKeys = issues.map(i => i.key);
65+
const openSlaResults = await tts.getIssueSLABatch(openKeys, 15);
66+
5967
const slaHealth = { breached: 0, breachedClosed: 0, approaching: 0, within: 0 };
60-
for (const ticket of primaryTickets) {
61-
if (ticket.sla?.status === 'breached') {
68+
for (const [_key, slaResponse] of openSlaResults) {
69+
const status = tts.parseSLAStatus(slaResponse);
70+
if (status.status === 'breached') {
6271
slaHealth.breached++;
63-
} else if (ticket.sla?.status === 'approaching') {
72+
} else if (status.status === 'approaching') {
6473
slaHealth.approaching++;
65-
} else if (ticket.sla?.status === 'within') {
74+
} else if (status.status === 'within') {
6675
slaHealth.within++;
6776
}
6877
}
@@ -78,21 +87,6 @@ export async function getTeamSummary(
7887
}
7988
}
8089

81-
// Aggregate enrichment counts from parsed attachments
82-
let cisaKevTickets = 0;
83-
let highEpssTickets = 0;
84-
let internetExposedTickets = 0;
85-
86-
for (const ticket of primaryTickets) {
87-
if (ticket.enrichment) {
88-
if (ticket.enrichment.cisaKevCount > 0) cisaKevTickets++;
89-
if (ticket.enrichment.highEpssCount > 0) highEpssTickets++;
90-
}
91-
if (ticket.criticality) {
92-
if (ticket.criticality.hasInternetExposure) internetExposedTickets++;
93-
}
94-
}
95-
9690
// Calculate 7-day trend
9791
const sevenDaysAgo = new Date();
9892
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
@@ -116,15 +110,10 @@ export async function getTeamSummary(
116110

117111
return {
118112
squad: squad || 'All PDE',
119-
openCount: primaryTickets.length,
113+
openCount: issues.length,
120114
bySeverity,
121115
slaHealth,
122116
sources,
123117
trend7d,
124-
riskIndicators: {
125-
cisaKevTickets,
126-
highEpssTickets,
127-
internetExposedTickets,
128-
},
129118
};
130119
}

src/types/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ export interface TeamSummary {
119119
resolved: number;
120120
net: number;
121121
};
122-
riskIndicators: {
123-
cisaKevTickets: number;
124-
highEpssTickets: number;
125-
internetExposedTickets: number;
126-
};
127122
}
128123

129124
export interface RemediationGroup {

0 commit comments

Comments
 (0)