Problem
GET /v1/contributors/:login/decision-pack can return needs_snapshot_refresh with no actions even when core repo signal fidelity is complete. That makes MCP/agent usage feel empty at the exact moment a contributor is asking what to do next.
Desired behavior
Return the last usable decision-pack snapshot when one exists, clearly mark it as stale, and enqueue a refresh in the background. If no usable snapshot exists, return a bounded needs_snapshot_refresh response with enough status for the client to explain what is happening.
Implementation notes
- Start in
src/services/decision-pack.ts and the agent orchestration path that calls it.
- Preserve Worker budget safety: do not scan all cached issues or PRs inline.
- Prefer latest
signal_snapshots first, then bounded rebuild only when it is safe.
- Add explicit freshness fields:
fresh | stale | rebuilding | missing.
- MCP
agent plan should degrade gracefully instead of returning an empty-looking result.
Public/private boundaries
This can include private scoreability context only in authenticated API/MCP responses. Do not add public GitHub comments or public check output for this issue.
Acceptance criteria
- A contributor gets actionable recommendations from a stale but usable snapshot.
- Response includes snapshot age, freshness status, and rebuild status.
- A background rebuild is queued when needed.
- No broad issue/PR scans happen inline on request paths.
jsonbored or a fixture contributor no longer receives an empty agent plan solely because the pack is stale.
Tests
- Fresh snapshot returns normal decision pack.
- Stale snapshot returns actionable data plus freshness warning.
- Missing snapshot returns bounded
needs_snapshot_refresh and queues rebuild.
- Rebuild-queued response is deterministic.
- Performance regression proves the request path does not call broad issue/PR list helpers.
Problem
GET /v1/contributors/:login/decision-packcan returnneeds_snapshot_refreshwith no actions even when core repo signal fidelity is complete. That makes MCP/agent usage feel empty at the exact moment a contributor is asking what to do next.Desired behavior
Return the last usable decision-pack snapshot when one exists, clearly mark it as stale, and enqueue a refresh in the background. If no usable snapshot exists, return a bounded
needs_snapshot_refreshresponse with enough status for the client to explain what is happening.Implementation notes
src/services/decision-pack.tsand the agent orchestration path that calls it.signal_snapshotsfirst, then bounded rebuild only when it is safe.fresh | stale | rebuilding | missing.agent planshould degrade gracefully instead of returning an empty-looking result.Public/private boundaries
This can include private scoreability context only in authenticated API/MCP responses. Do not add public GitHub comments or public check output for this issue.
Acceptance criteria
jsonboredor a fixture contributor no longer receives an empty agent plan solely because the pack is stale.Tests
needs_snapshot_refreshand queues rebuild.