Portfolio Management
Solve portfolio management tasks in a shared test environment. The environment exposes work items, mix targets, SLA policy, releases, milestones, blockers, and dependencies through REST endpoints and a read-only SQL query endpoint.
Workflow
- Read
environment_access.mdin the workspace for the base URL, allowed endpoints, and any required auth tokens. - Fetch reference data from the REST endpoints: work-items, mix-targets, sla-policy, releases, milestones, dependencies, blockers.
- Use POST /api/query (SQL) for filtered work-item queries when REST pagination or filtering is insufficient.
- Classify work items using category rules.
- Distinguish primary, duplicate, cancelled, and mirror-stale records using data quality rules.
- Compute metrics with correct precision: percentages to 1 decimal place, rates to 3 decimal places.
- Follow the answer template schema exactly. Produce valid JSON only.
Essential Rules
Precision
- Percentage points: round to 1 decimal place (e.g. 66.7, 11.1).
- Rates (breach_rate, readiness_score): round to 3 decimal places (e.g. 0.545, 0.688).
- Counts: integers.
Sorting
- Work item ID lists: lexicographically ascending unless the task asks for closed_at-then-id ordering.
- Team lists: alphabetically ascending.
- Categories in gap/mix tables: always order NewFeature, TechDebt, Reliability, Security.
- Duplicate clusters: sort by
primary_idascending;duplicate_idswithin each cluster sorted ascending.
Work Item Authoritative Fields
- Use
status,work_type,labels,title,team,product_area,owner,severity,priority,closed_at,created_at,due_at,duplicate_of,milestone_id,release_id. - Never use
mirror_statusas the source of truth for a work item's real status. - Never use
legacy_categoryas the portfolio category. Classify using the rules in category_rules.md. duplicate_ofbeing non-null means the item is a duplicate referencing a primary. Exclude duplicates from primary counts.statusof "Cancelled" means the item is cancelled. Exclude cancelled items from primary counts.
SQL Query Endpoint
- POST
/api/querywith headerX-Env-Token: portfolio-readonly. - Body:
{"sql": "<SELECT or WITH statement>", "params": []}. - Only SELECT and WITH statements are allowed.
- Returns
{"columns": [...], "rows": [[...], ...], "row_count": N, "truncated": false}. - Use SQL for cross-entity queries (e.g. work items filtered by team, quarter, status; joins with releases or milestones).
Common Task Types
Portfolio Mix Review
- Fetch mix-targets, find the target row matching the given scope_id.
- Query work items in the relevant quarter, teams, product areas with status not Duplicate/Cancelled.
- Classify each included item into exactly one portfolio category.
- Count per category, compute actual percentages, gap = actual - target.
- Identify under-invested categories (negative gap).
- Exclude duplicate and cancelled records; report them in exclusion flags.
- Skip items whose
mirror_statusdisagrees with their realstatus— flagignored_mirror_status_and_legacy_category: true.
SLA Aging Review
- Fetch sla-policy for severity-to-days mapping.
- Query primary work items matching the given teams and categories (Reliability, Security).
- For each item, compute age:
as_of_date - created_atin days. - Determine if overdue:
age > sla_policy[severity].days_to_due. - Compute aging bucket distribution, team overdue counts, owner hotspot.
- Identify duplicate clusters via
duplicate_of. - Compute breach_rate = overdue_primary_count / included_primary_count (3 decimal places).
Release Readiness
- Fetch the release by ID, its milestones, and all work items on those milestones.
- Count completed primary items per milestone; compute completion_pct.
- Identify non-complete gating items (status not Closed/Verified/Done/Deployed).
- Fetch unresolved high-impact blockers (severity High or Critical, status not Resolved).
- Trace dependency chains from blocked release work items to non-complete dependencies.
- Compute readiness_score = completed_primary / primary_total (3 decimal places).
- Ship decision: SHIP if >= 0.95 and no high-impact blockers; SHIP_WITH_WATCH if >= 0.80 with blockers; NO_SHIP otherwise.
Escalation Queue
- When building an escalation queue for SLA tasks, order overdue primary items by severity (S1 first, then S2, S3, S4), then by age descending within each severity tier.
References
- portfolio_api.md — Full API endpoint and SQL schema reference
- category_rules.md — How to classify work items into portfolio categories
- data_quality.md — Duplicate, cancelled, mirror-stale, and distractor detection
Scripts
- query_portfolio.py — Run a read-only SQL query against the task environment