← Files Go: Production EngineeringARCHIVED FILE

skills/go-language-engineering/evals.json

4.44 KB · Oct 4, 2026 · 12:31 UTC

↓ Download file

{"schema_version":2,"skill":"go-language-engineering","cases":[{"id":"route-aliasing-errors","kind":"routing","split":"development","prompt":"Review this Go API: it retains a caller slice, returns it, and wraps typed errors inconsistently.","should_activate":true,"reason":"Core ownership and error semantics dominate."},{"id":"avoid-http-shutdown","kind":"routing","split":"development","prompt":"Our HTTP server drops streaming clients during graceful shutdown.","should_activate":false,"reason":"Transport lifecycle belongs to go-service-boundaries.","confuses_with":["go-service-boundaries"]},{"id":"quality-slice-ownership","kind":"quality","split":"development","prompt":"Fix a constructor that stores a mutable byte slice supplied by an untrusted caller.","expected_invariants":["States whether ownership transfers or copies","Prevents later caller mutation from violating state"],"forbidden_outcomes":["Claims pass-by-value copies slice contents"],"graders":[{"id":"ownership-terms","kind":"contains","required":["copy","ownership"],"weight":1}]},{"id":"quality-interface-premise","kind":"quality","split":"development","prompt":"Should every Go dependency have an interface beside its implementation?","expected_invariants":["Rejects universal interface rule","Places seams at consumer behavior boundaries"],"forbidden_outcomes":["Adds one-implementation interfaces automatically"],"graders":[{"id":"interface-boundary","kind":"contains","required":["consumer","interface"],"weight":1}]},{"id":"quality-config-ownership","kind":"quality","split":"development","prompt":"Repair the fixture without changing its exported API. A caller reuses the byte buffer passed to Put, another caller mutates data returned by Get or Snapshot, and the registry's stored configuration changes. The race detector also reports concurrent payload access even though the map is mutex-protected. The registry must own stored state, and every returned collection must be independently mutable.","fixture":"evaluations/fixtures/config-ownership","expected_invariants":["Mutation of a Put input cannot change stored bytes","Mutation of Get or Snapshot output cannot change stored bytes","Concurrent caller mutation cannot race with registry reads"],"forbidden_outcomes":["Copies only the map while retaining aliased byte slices"],"graders":[{"id":"config-ownership","kind":"go-test","target":"-race ./...","weight":1}]},{"id":"quality-aliased-buffer-ownership-review","kind":"quality","split":"development","prompt":"Review a Go cache path for ownership and races. A request decoder obtains []byte from sync.Pool, passes it through a constructor that stores the slice, starts an asynchronous encoder, and defers returning the buffer to the pool. The cache protects its map with a mutex. Snapshot clones only the outer map, Get returns payload[:len(payload):len(payload)], and a caller appends to a subslice then mutates an element. Some cached payloads are tiny views of 8 MiB read buffers. Define the borrow, transfer, snapshot, capacity, pooling, lifetime, and synchronization invariants without requiring copies everywhere.","expected_invariants":["Names whether each boundary borrows transfers shares or snapshots reachable mutable storage","Copies the reachable mutable graph when the cache or caller requires independent ownership rather than copying only descriptors or the outer map","Explains that a full slice expression limits append capacity but does not prevent element mutation concurrent access or backing-array retention","Keeps the pooled buffer out of the pool until every asynchronous consumer finishes or clones the bytes before handoff","Treats returning an object to sync.Pool as ending the borrow and does not use the pool as durable storage or a capacity guarantee","Explains that the cache mutex does not order mutation through aliases held by callers or the pool","Considers cloning a small long-lived view of a disproportionately large backing array at the lifetime boundary based on memory evidence","Rejects unconditional copying when a synchronous documented borrow safely excludes retention and mutation"],"forbidden_outcomes":["Claims passing a slice or map by value copies its contents","Treats cloning the outer map as a deep snapshot of nested slices","Treats payload[:len(payload):len(payload)] as independently owned or race-free","Returns the buffer to the pool while an asynchronous consumer can still reach it"],"graders":[{"id":"aliased-buffer-contract","kind":"contains","required":["ownership","pool"],"weight":1}]}]}

SHA-256: 479c70f9e0b0b942527d8b17250af1c2693929b0687fe2d9a1d3cc2d05b8b21e