@@ -4,6 +4,10 @@ import (
44 "testing"
55)
66
7+ // @trace SPEC-17.11
8+ // @trace SPEC-17.12
9+
10+ // @trace SPEC-17.06
711func TestIsFastPath (t * testing.T ) {
812 tests := []struct {
913 prompt string
@@ -29,13 +33,17 @@ func TestIsFastPath(t *testing.T) {
2933 }
3034}
3135
36+ // @trace SPEC-17.02
37+ // @trace SPEC-17.03
3238func TestExtractSignals_MultipleFiles (t * testing.T ) {
3339 s := ExtractSignals ("Update main.go and utils.py to fix the bug" )
3440 if ! s .ReferencesMultipleFiles {
3541 t .Error ("expected ReferencesMultipleFiles=true for prompt with two file extensions" )
3642 }
3743}
3844
45+ // @trace SPEC-17.02
46+ // @trace SPEC-17.03
3947func TestExtractSignals_ModulePair (t * testing.T ) {
4048 s := ExtractSignals ("coordinate auth and api modules" )
4149 if ! s .ReferencesMultipleFiles {
@@ -46,76 +54,97 @@ func TestExtractSignals_ModulePair(t *testing.T) {
4654 }
4755}
4856
57+ // @trace SPEC-17.02
58+ // @trace SPEC-17.03
4959func TestExtractSignals_CrossContext (t * testing.T ) {
5060 s := ExtractSignals ("why does this fail when we pass nil?" )
5161 if ! s .RequiresCrossContextReasoning {
5262 t .Error ("expected RequiresCrossContextReasoning=true" )
5363 }
5464}
5565
66+ // @trace SPEC-17.02
67+ // @trace SPEC-17.03
5668func TestExtractSignals_Debugging (t * testing.T ) {
5769 s := ExtractSignals ("debug the error in the handler" )
5870 if ! s .DebuggingTask {
5971 t .Error ("expected DebuggingTask=true" )
6072 }
6173}
6274
75+ // @trace SPEC-17.02
76+ // @trace SPEC-17.03
6377func TestExtractSignals_ExhaustiveSearch (t * testing.T ) {
6478 s := ExtractSignals ("find all instances of the deprecated function" )
6579 if ! s .RequiresExhaustiveSearch {
6680 t .Error ("expected RequiresExhaustiveSearch=true" )
6781 }
6882}
6983
84+ // @trace SPEC-17.02
85+ // @trace SPEC-17.03
7086func TestExtractSignals_Security (t * testing.T ) {
7187 s := ExtractSignals ("check for SQL injection vulnerabilities" )
7288 if ! s .SecurityReviewTask {
7389 t .Error ("expected SecurityReviewTask=true" )
7490 }
7591}
7692
93+ // @trace SPEC-17.02
94+ // @trace SPEC-17.03
7795func TestExtractSignals_Architecture (t * testing.T ) {
7896 s := ExtractSignals ("how does the authentication system work?" )
7997 if ! s .ArchitectureAnalysis {
8098 t .Error ("expected ArchitectureAnalysis=true" )
8199 }
82100}
83101
102+ // @trace SPEC-17.02
103+ // @trace SPEC-17.03
84104func TestExtractSignals_Refactor (t * testing.T ) {
85105 s := ExtractSignals ("Refactor the auth system across all handlers to use JWT" )
86106 if ! s .ArchitectureAnalysis {
87107 t .Error ("expected ArchitectureAnalysis=true for refactor" )
88108 }
89109}
90110
111+ // @trace SPEC-17.02
112+ // @trace SPEC-17.04
91113func TestExtractSignals_Thorough (t * testing.T ) {
92114 s := ExtractSignals ("make sure all tests pass before committing" )
93115 if ! s .UserWantsThorough {
94116 t .Error ("expected UserWantsThorough=true" )
95117 }
96118}
97119
120+ // @trace SPEC-17.02
121+ // @trace SPEC-17.05
98122func TestExtractSignals_Fast (t * testing.T ) {
99123 s := ExtractSignals ("just show me the file" )
100124 if ! s .UserWantsFast {
101125 t .Error ("expected UserWantsFast=true" )
102126 }
103127}
104128
129+ // @trace SPEC-17.02
130+ // @trace SPEC-17.04
105131func TestExtractSignals_Continuation (t * testing.T ) {
106132 s := ExtractSignals ("also fix the tests while you're at it" )
107133 if ! s .TaskIsContinuation {
108134 t .Error ("expected TaskIsContinuation=true" )
109135 }
110136}
111137
138+ // @trace SPEC-17.01
112139func TestShouldActivate_Simple (t * testing.T ) {
113140 activate , reason , mode := ShouldActivate ("yes" , "" , "" )
114141 if activate {
115142 t .Errorf ("expected no activation for 'yes', got reason=%s mode=%s" , reason , mode )
116143 }
117144}
118145
146+ // @trace SPEC-17.01
147+ // @trace SPEC-17.05
119148func TestShouldActivate_FastIntent (t * testing.T ) {
120149 activate , reason , _ := ShouldActivate ("just show me the file contents" , "" , "" )
121150 if activate {
@@ -126,6 +155,7 @@ func TestShouldActivate_FastIntent(t *testing.T) {
126155 }
127156}
128157
158+ // @trace SPEC-17.01
129159func TestShouldActivate_Debugging (t * testing.T ) {
130160 activate , reason , _ := ShouldActivate ("Debug why the API returns 500 errors on POST" , "" , "" )
131161 if ! activate {
@@ -136,6 +166,7 @@ func TestShouldActivate_Debugging(t *testing.T) {
136166 }
137167}
138168
169+ // @trace SPEC-17.01
139170func TestShouldActivate_Security (t * testing.T ) {
140171 activate , reason , _ := ShouldActivate ("Find all places where we access the database without auth" , "" , "" )
141172 if ! activate {
@@ -147,6 +178,7 @@ func TestShouldActivate_Security(t *testing.T) {
147178 }
148179}
149180
181+ // @trace SPEC-17.01
150182func TestShouldActivate_Architecture (t * testing.T ) {
151183 activate , reason , _ := ShouldActivate ("Refactor the auth system across all handlers to use JWT" , "" , "" )
152184 if ! activate {
@@ -158,6 +190,7 @@ func TestShouldActivate_Architecture(t *testing.T) {
158190 }
159191}
160192
193+ // @trace SPEC-17.01
161194func TestShouldActivate_MultiModule (t * testing.T ) {
162195 activate , reason , _ := ShouldActivate ("Update main.go and utils.py with the new config" , "" , "" )
163196 if ! activate {
@@ -168,6 +201,7 @@ func TestShouldActivate_MultiModule(t *testing.T) {
168201 }
169202}
170203
204+ // @trace SPEC-17.07
171205func TestSuggestMode_DPPhases (t * testing.T ) {
172206 tests := []struct {
173207 phase string
@@ -188,13 +222,15 @@ func TestSuggestMode_DPPhases(t *testing.T) {
188222 }
189223}
190224
225+ // @trace SPEC-17.08
191226func TestSuggestMode_NotActivated (t * testing.T ) {
192227 got := SuggestMode (false , "spec" )
193228 if got != "micro" {
194229 t .Errorf ("SuggestMode(false, spec) = %q, want micro" , got )
195230 }
196231}
197232
233+ // @trace SPEC-17.04
198234func TestScore_Accumulative (t * testing.T ) {
199235 s := Signals {
200236 ReferencesMultipleFiles : true ,
@@ -209,6 +245,7 @@ func TestScore_Accumulative(t *testing.T) {
209245 }
210246}
211247
248+ // @trace SPEC-17.04
212249func TestScore_BelowThreshold (t * testing.T ) {
213250 s := Signals {
214251 TaskIsContinuation : true , // +1, below threshold of 2
0 commit comments