Engineering Portfolio Auditor
Core Workflow
- Read the user prompt and answer template first. Treat the template as the output contract: exact keys, ordering notes, rounding precision, and no prose unless requested.
- Read the runtime access notes supplied with the task and query the provided environment for the authoritative records needed by the prompt.
- Build a small working table before calculating: include
id,status,duplicate_of,team,product_area,work_type,labels,title,owner,created_at,due_at,closed_at,severity,priority,release_id, andmilestone_idwhen present. - Use authoritative current fields. Do not use stale mirror/export fields or legacy category fields to decide inclusion, completion, or category.
- Return only JSON matching the template. Sort and round exactly as the prompt says.
Primary Records
- Treat records with
duplicate_ofset, or currentstatusofDuplicate, as non-primary. Report them only in duplicate or exclusion fields when the template asks. - Treat current
statusofCancelledas non-primary unless the prompt explicitly asks for cancelled records. Report them as exclusions or distractors when requested. - Do not exclude a record just because its ID format looks different from nearby records. If it matches the authoritative scope and is primary, count it.
- For completed work, prefer current
statusover mirror fields. Common complete statuses areDone,Closed,Verified, andDeployed. - For closed-window tasks, use
closed_atfor quarter/window membership and for closed-date ordering.
Portfolio Mix
Use item counts, not story points.
- Filter by the prompt scope: quarter, teams, product areas, and any scope-specific target row.
- Include primary records closed in the requested quarter/window.
- Exclude duplicates and cancelled records, but list them in the requested exclusion or distractor fields.
- Classify each included item into exactly one category:
Security: current security/compliance work, especiallywork_typeofSecurityorCompliance, or non-stale title/label signals such as cve, security, encryption audit, auth security, or security exception.Reliability: reliability or incident work, especiallywork_typeofReliabilityorIncident, or non-stale title/label signals such as outage, incident, latency, flaky reliability, postmortem, guardrail, or runbook.TechDebt: refactor, chore, dependency, migration, cleanup, or maintenance work when stronger security/reliability signals do not define the item.NewFeature: feature or enhancement work when stronger security/reliability signals do not define the item.
- Resolve conflicts using current
work_typeplus the non-stale title. Labels help classify generic bugs, chores, compliance, and enhancements, but an isolated stale label or legacy category should not override clear current work intent. - Convert target fractions to percentage points. Round actual percentages and gaps to one decimal place. Compute
gap = actual_pct - target_pct. - List under-invested categories as negative gaps ordered from most negative to least negative. For a rebalance recommendation, choose the largest deficit as the target category and the largest surplus as the source signal unless the prompt gives a different rule.
SLA Aging
- Filter primary work by the requested teams and portfolio categories.
- Include work that is open as of the as-of date, plus primary work closed within the recent closed lookback window when the prompt includes one.
- Keep duplicate clusters separate from the primary population. Group by canonical
duplicate_of, sort cluster primary IDs and duplicate IDs lexicographically. - Use
due_atas the breach boundary unless the prompt explicitly directs policy-derived due dates. An open item is overdue whendue_atis before the as-of date. A closed item breached whenclosed_atis afterdue_at. - Treat items due exactly on the as-of date as due today, not overdue, unless the prompt states otherwise.
- For aging buckets, count included primary records by age in days from
created_attoclosed_atfor recently closed work, otherwise fromcreated_atto the as-of date. Use the bucket boundaries exactly as named. - Count missing owners only among included primary records. Use
UNASSIGNEDfor hotspot grouping when the owner is missing. - Compute breach rate as overdue primary count divided by included primary count, rounded to the requested precision.
- For escalation queues, sort overdue primary work by severity (
S1beforeS2beforeS3beforeS4), then priority number ascending, then due date ascending, then ID. If the prompt frames the queue as active follow-up, put still-open overdue work before recently closed breaches.
Release Readiness
- Use release membership from authoritative release/work item fields, not mirror fields.
- Build milestone denominators from primary release work items. Exclude duplicate and cancelled release rows from primary totals.
- Count complete work with current complete statuses such as
Done,Closed,Verified, andDeployed. - Sort milestone rows by milestone ID. Round completion percentages to one decimal place.
- Gating work item IDs are primary release work items that are not complete, sorted with no duplicates, unless the prompt narrows the definition.
- Count unresolved high-impact blockers by exact cause text. Treat unresolved as not resolved; treat high impact as
HighandCriticalunless the prompt defines another severity set. - Build dependency chains from release work toward dependencies whose authoritative status is not complete. Prefer readiness-blocking and validation relations when distinguishing critical chains. Sort paths lexicographically by the full ordered path.
- Use
NO_SHIPwhen unresolved high-impact blockers or non-complete readiness gates remain. UseSHIP_WITH_WATCHfor only low-impact or monitoring concerns. UseSHIPonly when primary work is complete and no unresolved readiness blockers remain. - Readiness score is completed primary release work divided by the primary denominator, rounded to three decimals unless the template says otherwise.
Output Discipline
- Follow template-specific ordering even when it differs from these defaults.
- Sort ID lists lexicographically unless the prompt or template asks for closed-date ordering.
- Do not add fields, comments, markdown, or explanatory prose to the JSON answer.