Skip to content

Commit dd589f8

Browse files
jensneuseclaude
andcommitted
docs: clarify exported public-API contract for cosmo-only symbols
ysmolski flagged three exported symbols as suspicious because their only callers in this repository are tests. The author's intent was to expose them for external consumers (wundergraph/cosmo router). Add minimal godoc comments to make the contract explicit: - MergeRepresentationVariableNodes also has one in-repo production caller (visitor.go:1812), confirming public-API status. - RecordL2KeyEvent and RecordFetchTiming have zero in-repo production callers; doc notes they are kept exported for cosmo and should be internalized in the next breaking window if cosmo stops using them. No signature changes, no internalization. Addresses ysmolski review on PR #1259 (representation_variable.go:21, cache_analytics.go:278). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2427062 commit dd589f8

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

v2/pkg/engine/plan/representation_variable.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func BuildRepresentationVariableNode(definition *ast.Document, cfg FederationFie
6363
}
6464

6565
// MergeRepresentationVariableNodes merges multiple representation variable objects into one.
66+
// It is part of the public planner API consumed by external integrations
67+
// such as wundergraph/cosmo; breaking changes require coordinated downstream updates.
6668
func MergeRepresentationVariableNodes(objects []*resolve.Object) *resolve.Object {
6769
fieldCount := 0
6870
for _, object := range objects {

v2/pkg/engine/resolve/cache_analytics.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ func (c *CacheAnalyticsCollector) RecordL1KeyEvent(kind CacheKeyEventKind, entit
274274
}
275275

276276
// RecordL2KeyEvent records an L2 cache key lookup event. Main thread only.
277+
// It is exported for external consumers such as cosmo router; this repository
278+
// has no production caller. If cosmo no longer uses it, internalize it in the next breaking window.
277279
// Use MergeL2Events to merge events collected on per-result slices from goroutines.
278280
func (c *CacheAnalyticsCollector) RecordL2KeyEvent(kind CacheKeyEventKind, entityType, cacheKey, dataSource string, byteSize int) {
279281
c.l2KeyEvents = append(c.l2KeyEvents, CacheKeyEvent{
@@ -352,6 +354,8 @@ func (c *CacheAnalyticsCollector) MergeEntitySources(sources []entitySourceRecor
352354
}
353355

354356
// RecordFetchTiming records a fetch timing event. Main thread only.
357+
// It is exported for external consumers such as cosmo router; this repository
358+
// has no production caller. If cosmo no longer uses it, internalize it in the next breaking window.
355359
func (c *CacheAnalyticsCollector) RecordFetchTiming(event FetchTimingEvent) {
356360
c.fetchTimings = append(c.fetchTimings, event)
357361
}

0 commit comments

Comments
 (0)