```ts
/** Counts held per bin, and the bins standing above a limit. */
export function binSpill(
  bins: Record<string, number>,
  limit: number,
): string[] {
  return Object.keys(bins)
    .filter((name) => bins[name] >= limit)
    .sort();
}

export function binAdd(
  bins: Record<string, number>,
  name: string,
  count: number,
): Record<string, number> {
  return { ...bins, [name]: (bins[name] ?? 0) + count };
}
```