# Core Cluster Lookup Callsite Inventory Design

## 1. Objective

Produce a precise inventory of remaining `CoreGrpcClient` cluster lookup usages for:

- `GetAnyClusterByID`
- `GetAvailableClusterByID`

in the **backup / restore / compact / crrf** domains.

## 2. Scope

### In Scope

- Production Go files under:
  - `app/models/backup`
  - `app/models/restore`
  - `app/workflow/action/backup`
  - `app/workflow/action/restore`
  - `app/workflow/action/crrf`
- Output fields:
  - file path
  - line number
  - method name (`GetAnyClusterByID` or `GetAvailableClusterByID`)

### Out of Scope

- `*_test.go`
- Other app domains (for example `biz_changefeed`, `ticdc`, `bucket`) unless they are under the in-scope directories above.
- Migration/refactor implementation in this step.

## 3. Collection Method

Use repository search with:

1. Method pattern: `GetAnyClusterByID|GetAvailableClusterByID`
2. In-scope directories only
3. Filter out test files by excluding `*_test.go`
4. Sort results to keep deterministic output

## 4. Output Contract

Each row follows:

`<file>:<line> | <method>`

Where:

- `<file>` is repo-relative path.
- `<line>` is the matched line number.
- `<method>` is extracted from the matched call expression.

## 5. Acceptance Criteria

- All listed entries are from production code under the in-scope directories.
- Every entry includes file, line, and method.
- No `*_test.go` entries appear.
- Both methods are covered if present.

## 6. Risks and Boundaries

- Dynamic indirection (for example helper wrappers hiding direct method names) is not covered by a pure call-name search.
- This design intentionally prioritizes accurate inventory over migration recommendations.
