MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestAdaptiveDepth

Function TestAdaptiveDepth

limits/limits_test.go:105–128  ·  view source on GitHub ↗

TestAdaptiveDepth verifies that tree depth shrinks proportionally with repo size, preventing hook startup from injecting massive tree output into context.

(t *testing.T)

Source from the content-addressed store, hash-verified

103// TestAdaptiveDepth verifies that tree depth shrinks proportionally with repo size,
104// preventing hook startup from injecting massive tree output into context.
105func TestAdaptiveDepth(t *testing.T) {
106 tests := []struct {
107 name string
108 fileCount int
109 wantDepth int
110 }{
111 {"unknown repo size defaults to shallow (0)", 0, 2},
112 {"negative treated as unknown", -1, 2},
113 {"small repo gets full depth", 100, 4},
114 {"medium repo threshold (2001)", 2001, 3},
115 {"large repo threshold (5001)", 5001, 2},
116 {"exactly medium threshold (2000)", 2000, 4},
117 {"exactly large threshold (5000)", 5000, 3},
118 }
119
120 for _, tt := range tests {
121 t.Run(tt.name, func(t *testing.T) {
122 got := AdaptiveDepth(tt.fileCount)
123 if got != tt.wantDepth {
124 t.Errorf("AdaptiveDepth(%d) = %d, want %d", tt.fileCount, got, tt.wantDepth)
125 }
126 })
127 }
128}
129
130// TestHandoffBudgetForRepo verifies that handoff list sizes scale down for large
131// repos to prevent context bloat in the session handoff output.

Callers

nothing calls this directly

Calls 1

AdaptiveDepthFunction · 0.85

Tested by

no test coverage detected