[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14774538793152,
    "event_type": "GoCreate",
    "goroutine_id": 19,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14774538798208,
    "event_type": "GoCreate",
    "goroutine_id": 20,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "20": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14774538801536,
    "event_type": "GoStart",
    "goroutine_id": 19,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14774538819200,
    "event_type": "GoStart",
    "goroutine_id": 20,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14774538831232,
    "event_type": "GoCreate",
    "goroutine_id": 21,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14774538838592,
    "event_type": "GoStart",
    "goroutine_id": 21,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14774538839488,
    "event_type": "GoCreate",
    "goroutine_id": 22,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "22": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 6,
  "timestamp_ns": 14774538839488,
  "event_type": "GoCreate",
  "goroutine_id": 22,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "19": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "20": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "21": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "22": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoStart", "goroutine_id": 8}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14774538793152,
    "event_type": "GoCreate",
    "goroutine_id": 19,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14774538798208,
    "event_type": "GoCreate",
    "goroutine_id": 20,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "20": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14774538801536,
    "event_type": "GoStart",
    "goroutine_id": 19,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14774538819200,
    "event_type": "GoStart",
    "goroutine_id": 20,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14774538831232,
    "event_type": "GoCreate",
    "goroutine_id": 21,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14774538838592,
    "event_type": "GoStart",
    "goroutine_id": 21,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14774538839488,
    "event_type": "GoCreate",
    "goroutine_id": 22,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "19": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "20": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "21": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "22": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 6,
  "timestamp_ns": 14774538839488,
  "event_type": "GoCreate",
  "goroutine_id": 22,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "19": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "20": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "21": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "22": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoStart", "goroutine_id": 23}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14778605950080,
    "event_type": "GoCreate",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14778605957824,
    "event_type": "GoCreate",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14778605966528,
    "event_type": "GoStart",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14778605968128,
    "event_type": "GoCreate",
    "goroutine_id": 37,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14778605979200,
    "event_type": "GoCreate",
    "goroutine_id": 38,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14778605983104,
    "event_type": "GoCreate",
    "goroutine_id": 39,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14778605984320,
    "event_type": "GoStart",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 7,
    "timestamp_ns": 14778605986240,
    "event_type": "GoCreate",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      },
      "40": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 7,
  "timestamp_ns": 14778605986240,
  "event_type": "GoCreate",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "37": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    },
    "39": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*NamespaceController).Run"
    },
    "40": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoBlock", "goroutine_id": 35}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14778605950080,
    "event_type": "GoCreate",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14778605957824,
    "event_type": "GoCreate",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14778605966528,
    "event_type": "GoStart",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14778605968128,
    "event_type": "GoCreate",
    "goroutine_id": 37,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14778605979200,
    "event_type": "GoCreate",
    "goroutine_id": 38,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14778605983104,
    "event_type": "GoCreate",
    "goroutine_id": 39,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14778605984320,
    "event_type": "GoStart",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 7,
    "timestamp_ns": 14778605986240,
    "event_type": "GoCreate",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      },
      "40": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 7,
  "timestamp_ns": 14778605986240,
  "event_type": "GoCreate",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "37": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    },
    "39": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*NamespaceController).Run"
    },
    "40": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoStart", "goroutine_id": 10}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14778605950080,
    "event_type": "GoCreate",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14778605957824,
    "event_type": "GoCreate",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14778605966528,
    "event_type": "GoStart",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14778605968128,
    "event_type": "GoCreate",
    "goroutine_id": 37,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14778605979200,
    "event_type": "GoCreate",
    "goroutine_id": 38,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14778605983104,
    "event_type": "GoCreate",
    "goroutine_id": 39,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14778605984320,
    "event_type": "GoStart",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 7,
    "timestamp_ns": 14778605986240,
    "event_type": "GoCreate",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      },
      "40": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 7,
  "timestamp_ns": 14778605986240,
  "event_type": "GoCreate",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "37": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    },
    "39": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*NamespaceController).Run"
    },
    "40": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoStart", "goroutine_id": 23}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14778605950080,
    "event_type": "GoCreate",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14778605957824,
    "event_type": "GoCreate",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14778605966528,
    "event_type": "GoStart",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14778605968128,
    "event_type": "GoCreate",
    "goroutine_id": 37,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14778605979200,
    "event_type": "GoCreate",
    "goroutine_id": 38,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14778605983104,
    "event_type": "GoCreate",
    "goroutine_id": 39,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14778605984320,
    "event_type": "GoStart",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 7,
    "timestamp_ns": 14778605986240,
    "event_type": "GoCreate",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      },
      "40": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 7,
  "timestamp_ns": 14778605986240,
  "event_type": "GoCreate",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "37": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    },
    "39": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*NamespaceController).Run"
    },
    "40": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoSched", "goroutine_id": 19}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 0,
    "timestamp_ns": 14778605950080,
    "event_type": "GoCreate",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 1,
    "timestamp_ns": 14778605957824,
    "event_type": "GoCreate",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.traceStartReadCPU"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 2,
    "timestamp_ns": 14778605966528,
    "event_type": "GoStart",
    "goroutine_id": 35,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 3,
    "timestamp_ns": 14778605968128,
    "event_type": "GoCreate",
    "goroutine_id": 37,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 4,
    "timestamp_ns": 14778605979200,
    "event_type": "GoCreate",
    "goroutine_id": 38,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 5,
    "timestamp_ns": 14778605983104,
    "event_type": "GoCreate",
    "goroutine_id": 39,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.(*traceAdvancerState).start"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 6,
    "timestamp_ns": 14778605984320,
    "event_type": "GoStart",
    "goroutine_id": 36,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      }
    },
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 7,
    "timestamp_ns": 14778605986240,
    "event_type": "GoCreate",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "37": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*federatedInformerImpl).Start"
      },
      "39": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*NamespaceController).Run"
      },
      "40": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 7,
  "timestamp_ns": 14778605986240,
  "event_type": "GoCreate",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "37": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime/trace.(*traceMultiplexer).startLocked"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*federatedInformerImpl).Start"
    },
    "39": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*NamespaceController).Run"
    },
    "40": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "main.(*DelayingDeliverer).StartWithHandler"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoStart", "goroutine_id": 37}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 9,
    "timestamp_ns": 14775552809152,
    "event_type": "GoBlock",
    "goroutine_id": 36,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 10,
    "timestamp_ns": 14775552809856,
    "event_type": "GoStart",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 11,
    "timestamp_ns": 14775552816000,
    "event_type": "GoSched",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 12,
    "timestamp_ns": 14775552837440,
    "event_type": "GoSched",
    "goroutine_id": 38,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 13,
    "timestamp_ns": 14775552848896,
    "event_type": "GoStart",
    "goroutine_id": 37,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 14,
    "timestamp_ns": 14775552854976,
    "event_type": "GoStart",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 15,
    "timestamp_ns": 14775552857536,
    "event_type": "GoEnd",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 16,
    "timestamp_ns": 14775552861696,
    "event_type": "GoBlock",
    "goroutine_id": 37,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 17,
    "timestamp_ns": 14775552866240,
    "event_type": "GoStart",
    "goroutine_id": 40,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 18,
    "timestamp_ns": 14775552875200,
    "event_type": "GoBlock",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "blocked",
        "blocked_on": "chan receive",
        "locals_hint": "runtime.chanrecv1"
      },
      "37": {
        "status": "running",
        "blocked_on": "syscall",
        "locals_hint": "syscall.syscall"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.lock2"
      },
      "40": {
        "status": "blocked",
        "blocked_on": "sync",
        "locals_hint": "sync.(*Mutex).Lock"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 18,
  "timestamp_ns": 14775552875200,
  "event_type": "GoBlock",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "blocked",
      "blocked_on": "chan receive",
      "locals_hint": "runtime.chanrecv1"
    },
    "37": {
      "status": "running",
      "blocked_on": "syscall",
      "locals_hint": "syscall.syscall"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime.lock2"
    },
    "40": {
      "status": "blocked",
      "blocked_on": "sync",
      "locals_hint": "sync.(*Mutex).Lock"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoUnblock", "goroutine_id": 37}


[System] You are a code execution simulator.

[User]
You are reasoning about concurrent Go program execution.

Here is a Go program:
<program>
// WEAVE_META
// outcome: leak
// concurrency_pattern: mutex
// goroutine_count: 3
// expected_nondeterminism: medium
// description: Human-written GoBench bug kernel kubernetes_30872 (leak)

package main

import (
	"os"
	"runtime/trace"
	"sync"
	)

type PopProcessFunc func()

type ProcessFunc func()

func Util(f func(), stopCh <-chan struct{}) {
	JitterUntil(f, stopCh)
}

func JitterUntil(f func(), stopCh <-chan struct{}) {
	for {
		select {
		case <-stopCh:
			return
		default:
		}
		func() {
			f()
		}()
	}
}

type Queue interface {
	HasSynced()
	Pop(PopProcessFunc)
}

type Config struct {
	Queue
	Process ProcessFunc
}

type Controller struct {
	config Config
}

func (c *Controller) Run(stopCh <-chan struct{}) {
	Util(c.processLoop, stopCh)
}

func (c *Controller) HasSynced() {
	c.config.Queue.HasSynced()
}

func (c *Controller) processLoop() {
	c.config.Queue.Pop(PopProcessFunc(c.config.Process))
}

type ControllerInterface interface {
	Run(<-chan struct{})
	HasSynced()
}

type ResourceEventHandler interface {
	OnAdd()
}

type ResourceEventHandlerFuncs struct {
	AddFunc func()
}

func (r ResourceEventHandlerFuncs) OnAdd() {
	if r.AddFunc != nil {
		r.AddFunc()
	}
}

type informer struct {
	controller ControllerInterface

	stopChan chan struct{}
}

type federatedInformerImpl struct {
	sync.Mutex
	clusterInformer informer
}

func (f *federatedInformerImpl) ClustersSynced() {
	f.Lock()
	defer f.Unlock()
	f.clusterInformer.controller.HasSynced()
}

func (f *federatedInformerImpl) addCluster() {
	f.Lock()
	defer f.Unlock()
}

func (f *federatedInformerImpl) Start() {
	f.Lock()
	defer f.Unlock()

	f.clusterInformer.stopChan = make(chan struct{})
	go f.clusterInformer.controller.Run(f.clusterInformer.stopChan)
}

func (f *federatedInformerImpl) Stop() {
	f.Lock()
	defer f.Unlock()
	close(f.clusterInformer.stopChan)
}

type DelayingDeliverer struct{}

func (d *DelayingDeliverer) StartWithHandler(handler func()) {
	go func() {
		handler()
	}()
}

type FederationView interface {
	ClustersSynced()
}

type FederatedInformer interface {
	FederationView
	Start()
	Stop()
}

type NamespaceController struct {
	namespaceDeliverer         *DelayingDeliverer
	namespaceFederatedInformer FederatedInformer
}

func (nc *NamespaceController) isSynced() {
	nc.namespaceFederatedInformer.ClustersSynced()
}

func (nc *NamespaceController) reconcileNamespace() {
	nc.isSynced()
}

func (nc *NamespaceController) Run(stopChan <-chan struct{}) {
	nc.namespaceFederatedInformer.Start()
	go func() {
		<-stopChan
		nc.namespaceFederatedInformer.Stop()
	}()
	nc.namespaceDeliverer.StartWithHandler(func() {
		nc.reconcileNamespace()
	})
}

type DeltaFIFO struct {
	lock sync.RWMutex
}

func (f *DeltaFIFO) HasSynced() {
	f.lock.Lock()
	defer f.lock.Unlock()
}

func (f *DeltaFIFO) Pop(process PopProcessFunc) {
	f.lock.Lock()
	defer f.lock.Unlock()
	process()
}

func NewFederatedInformer() FederatedInformer {
	federatedInformer := &federatedInformerImpl{}
	federatedInformer.clusterInformer.controller = NewInformer(
		ResourceEventHandlerFuncs{
			AddFunc: func() {
				federatedInformer.addCluster()
			},
		})
	return federatedInformer
}

func NewInformer(h ResourceEventHandler) *Controller {
	fifo := &DeltaFIFO{}
	cfg := &Config{
		Queue: fifo,
		Process: func() {
			h.OnAdd()
		},
	}
	return &Controller{config: *cfg}
}

func NewNamespaceController() *NamespaceController {
	nc := &NamespaceController{}
	nc.namespaceDeliverer = &DelayingDeliverer{}
	nc.namespaceFederatedInformer = NewFederatedInformer()
	return nc
}

func main() {
	if tf := os.Getenv("WEAVE_TRACE_FILE"); tf != "" {
		f, err := os.Create(tf)
		if err == nil {
			if err := trace.Start(f); err == nil {
				defer func() { trace.Stop(); f.Close() }()
			}
		}
	}

	namespaceController := NewNamespaceController()
	stop := make(chan struct{})
	namespaceController.Run(stop)
	close(stop)
}

</program>

Here is a partial execution trace showing goroutine scheduler events so far:
<trace>
[
  {
    "event_id": 9,
    "timestamp_ns": 14775552809152,
    "event_type": "GoBlock",
    "goroutine_id": 36,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 10,
    "timestamp_ns": 14775552809856,
    "event_type": "GoStart",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 11,
    "timestamp_ns": 14775552816000,
    "event_type": "GoSched",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 12,
    "timestamp_ns": 14775552837440,
    "event_type": "GoSched",
    "goroutine_id": 38,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 13,
    "timestamp_ns": 14775552848896,
    "event_type": "GoStart",
    "goroutine_id": 37,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 14,
    "timestamp_ns": 14775552854976,
    "event_type": "GoStart",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 15,
    "timestamp_ns": 14775552857536,
    "event_type": "GoEnd",
    "goroutine_id": 39,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 16,
    "timestamp_ns": 14775552861696,
    "event_type": "GoBlock",
    "goroutine_id": 37,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 17,
    "timestamp_ns": 14775552866240,
    "event_type": "GoStart",
    "goroutine_id": 40,
    "goroutines": "... [TRUNCATED FOR LENGTH] ...",
    "channels": {},
    "mutexes": {}
  },
  {
    "event_id": 18,
    "timestamp_ns": 14775552875200,
    "event_type": "GoBlock",
    "goroutine_id": 40,
    "goroutines": {
      "1": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "35": {
        "status": "running",
        "blocked_on": null,
        "locals_hint": "unknown"
      },
      "36": {
        "status": "blocked",
        "blocked_on": "chan receive",
        "locals_hint": "runtime.chanrecv1"
      },
      "37": {
        "status": "running",
        "blocked_on": "syscall",
        "locals_hint": "syscall.syscall"
      },
      "38": {
        "status": "runnable",
        "blocked_on": null,
        "locals_hint": "runtime.lock2"
      },
      "40": {
        "status": "blocked",
        "blocked_on": "sync",
        "locals_hint": "sync.(*Mutex).Lock"
      }
    },
    "channels": {},
    "mutexes": {}
  }
]
</trace>

The current goroutine states are:
<current_state>
{
  "event_id": 18,
  "timestamp_ns": 14775552875200,
  "event_type": "GoBlock",
  "goroutine_id": 40,
  "goroutines": {
    "1": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "35": {
      "status": "running",
      "blocked_on": null,
      "locals_hint": "unknown"
    },
    "36": {
      "status": "blocked",
      "blocked_on": "chan receive",
      "locals_hint": "runtime.chanrecv1"
    },
    "37": {
      "status": "running",
      "blocked_on": "syscall",
      "locals_hint": "syscall.syscall"
    },
    "38": {
      "status": "runnable",
      "blocked_on": null,
      "locals_hint": "runtime.lock2"
    },
    "40": {
      "status": "blocked",
      "blocked_on": "sync",
      "locals_hint": "sync.(*Mutex).Lock"
    }
  },
  "channels": {},
  "mutexes": {}
}
</current_state>

Predict the next scheduler event. What happens next?
Respond in JSON only — no markdown fences, no text outside the JSON object:
{"event_type":"GoStart|GoBlock|GoUnblock|GoCreate|GoEnd|GoSched","goroutine_id":<integer>,"reasoning":"<brief explanation>","confidence":"high|medium|low"}

[Assistant] {"event_type": "GoBlock", "goroutine_id": 21}