···444444func runDetectionParallel(ctx context.Context, mgr BundleManager, setup *detectorSetup, start, end int, workers int, showProgress bool) error {
445445 totalBundles := end - start + 1
446446447447- // ✨ FIX: Don't create more workers than bundles
447447+ // Don't create more workers than bundles
448448 if workers > totalBundles {
449449 workers = totalBundles
450450 }
451451452452- // ✨ FIX: Use unbuffered channels to avoid blocking issues
452452+ // Use unbuffered channels to avoid blocking issues
453453 jobs := make(chan int, workers*2) // Small buffer for job numbers only
454454 results := make(chan detectionResult, workers*2)
455455···538538 // Collect matches
539539 allMatches = append(allMatches, res.matches...)
540540541541- // ✨ FIX: Output immediately (don't buffer too much)
541541+ // Output immediately (don't buffer too much)
542542 if len(allMatches) >= 500 {
543543 for _, match := range allMatches {
544544 fmt.Printf("%d,%s,%d,%.2f,%s\n",
+4-4
cmd/plcbundle/commands/did.go
···9797 }
9898 defer mgr.Close()
9999100100- // ✨ Resolve handle to DID with timing
100100+ // Resolve handle to DID with timing
101101 ctx := context.Background()
102102 did, handleResolveTime, err := mgr.ResolveHandleOrDID(ctx, input)
103103 if err != nil {
···209209210210 ctx := context.Background()
211211212212- // ✨ Resolve handle to DID with timing
212212+ // Resolve handle to DID with timing
213213 did, handleResolveTime, err := mgr.ResolveHandleOrDID(ctx, input)
214214 if err != nil {
215215 return err
···10301030 writeResult(nil, fmt.Errorf("not found"))
10311031 }
1032103210331033- // ✨ Process bundles in parallel - LoadOperations once per bundle
10331033+ // Process bundles in parallel - LoadOperations once per bundle
10341034 bundleJobs := make(chan bundleGroup, len(bundles))
10351035 var wg sync.WaitGroup
10361036···10461046 positions[i] = locations[didIdx].position
10471047 }
1048104810491049- // ✨ Load operations once for this bundle
10491049+ // Load operations once for this bundle
10501050 ops, err := mgr.LoadOperations(ctx, job.bundleNum, positions)
1051105110521052 if err != nil {
···106106 eta = time.Duration(float64(remaining)/speed) * time.Second
107107 }
108108109109- // ✨ FIX: Check if complete
109109+ // FIX: Check if complete
110110 isComplete := pb.current >= pb.total
111111112112 if pb.showBytes && pb.currentBytes > 0 {
···114114 mbPerSec := mbProcessed / elapsed.Seconds()
115115116116 if isComplete {
117117- // ✨ Don't show ETA when done
117117+ // Don't show ETA when done
118118 fmt.Fprintf(os.Stderr, "\r [%s] %6.2f%% | %d/%d | %.1f/s | %.1f MB/s | Done ",
119119 bar, percent, pb.current, pb.total, speed, mbPerSec)
120120 } else {
···123123 }
124124 } else {
125125 if isComplete {
126126- // ✨ Don't show ETA when done
126126+ // Don't show ETA when done
127127 fmt.Fprintf(os.Stderr, "\r [%s] %6.2f%% | %d/%d | %.1f/s | Done ",
128128 bar, percent, pb.current, pb.total, speed)
129129 } else {
···134134}
135135136136func formatETA(d time.Duration) string {
137137- // ✨ This should never be called with 0 now, but keep as fallback
137137+ // This should never be called with 0 now, but keep as fallback
138138 if d == 0 {
139139 return "0s"
140140 }
+1-1
detector/script.go
···146146 return nil, fmt.Errorf("not connected to server")
147147 }
148148149149- // ✨ LOCK for entire socket communication
149149+ // LOCK for entire socket communication
150150 d.mu.Lock()
151151 defer d.mu.Unlock()
152152
+1-1
internal/mempool/mempool.go
···199199 // Remove taken operations
200200 m.operations = m.operations[n:]
201201202202- // ✨ FIX: ALWAYS reset tracking after Take
202202+ // ALWAYS reset tracking after Take
203203 // Take() means we're consuming these ops for a bundle
204204 // Any remaining ops are "new" and unsaved
205205 m.lastSavedLen = 0