# Fix ap-southeast-2 historical project metrics routing

## Background

The NextGen historical Project Metrics fallback contains an inner `ap-southeast-2 -> ap-southeast-2-ng` mapping, but the outer region condition excludes `ap-southeast-2`. The intended branch is unreachable and requests use the raw datasource host.

## Goal and target contract

- Use `ap-southeast-2-ng` as the logical historical datasource region for AWS NextGen host clusters in `ap-southeast-2`.
- Keep the physical `ap-southeast-2` region in the O11Y metadata request.
- Preserve current `ap-south-1`, `ap-southeast-1`, and `us-west-2` special cases and all other providers/regions.
- Enter historical fallback only for `o11y.ErrNotFound`; propagate other lookup failures.

## Affected modules and route

- Root Go module: `pkg/proxy`, Project Metrics historical fallback.
- Executable/image/CD component: `cmd/server`, `clinic`, Clinic CD `components=clinic`.
- app-delivery application/workload: `clinic-api` / Clinic Deployment.

## Implementation

1. Extract a pure logical-region function for NextGen historical metrics.
2. Build the historical target with a logical datasource host and a physical-region O11Y request.
3. Replace the unreachable nested condition with the helper.
4. Use request context and trace-aware safe lifecycle logs in the modified path.
5. Add table-driven region tests plus a complete host/path/request-parameter assertion for `ap-southeast-2`.

## Compatibility and exclusions

- Dedicated historical routing, live internal-read routing, authentication, and authorization are unchanged.
- No public schema, database, workflow, or app-delivery configuration change is required.
- No fallback is added for transport, permission, or malformed metadata errors.

## Validation and release boundary

- Run focused `pkg/proxy` and `cmd/server` tests, formatting, and `git diff --check`.
- In staging deploy `components=clinic`, verify a historical Project Metrics request uses the `-ng` host while its metadata lookup keeps the physical region, then inspect image/Pod state and trace-correlated logs.
- Keep changes uncommitted, unpushed, and undeployed pending review.
