# Fix Essential V2 storage identity

## Background

The cluster URL resolver locates Essential V2 clusters with the canonical O11Y tenant, but still formats Slow Query and Top SQL storage paths with the legacy DBaaS organization ID. Essential V2 records can have a zero DBaaS organization ID, producing invalid storage paths.

## Goal and target contract

- Never emit a Slow Query or Top SQL URL containing tenant/org `0` for an Essential V2 user cluster.
- Prefer the canonical Slow Query bucket and object path supplied by O11Y `StorageInfo`.
- When O11Y does not provide Slow Query storage metadata, preserve the current bucket layout and substitute the canonical O11Y tenant.
- Keep resource-pool metrics and non-Essential storage behavior unchanged.

## Affected modules and consumers

- Root Go module: `pkg/o11y/urls`.
- Runtime consumers: Clinic API cluster-dataurls, old report and health-check flows, plus Task Manager health-check scanning.
- Images/CD components: `clinic` and `task-manager`.
- app-delivery application: `clinic-api`; Clinic and Task Manager workloads.

## Implementation

1. Detect the confirmed Essential V2 user-cluster shape where the legacy DBaaS organization ID is zero.
2. Derive a non-zero canonical storage tenant from the O11Y record, falling back to the cluster tenant only when it is valid.
3. Build the Slow Query URL from complete O11Y `StorageInfo[slowquery]` when present; otherwise use the existing region/bucket layout with the canonical tenant and O11Y cluster ID.
4. Preserve the Top SQL layout while replacing only the org component with the canonical tenant.
5. Fail closed when the O11Y record or canonical tenant cannot be resolved.

## Compatibility and exclusions

- Existing Premium, Dedicated, BYOC, Shared, and resource-pool URL layouts remain unchanged.
- Essential V2 metrics routing from #1643 is not modified.
- No API schema, database, workflow, or app-delivery configuration changes are required.

## Validation

- Add final URL tests for O11Y StorageInfo, template fallback, and missing canonical identity.
- Run focused and full tests for `pkg/o11y/urls`, relevant API consumers, Task Manager health-check, formatting, and `git diff --check`.
- In staging deploy `components=clinic,task-manager`, inspect both images/workloads, and verify canonical cluster-dataurls before dependent Data Service changes.

## Release boundary

This branch remains uncommitted and undeployed until review. Production requires separate authorization.
