# Goal

Introduced a new scheduling strategy for readers that optimizes shard distribution. This ensures shards are balanced as evenly as possible across different workload patterns.

## Subgoal 1

Currently, only the "round-robin" scheduling method is supported. You are now required to implement a new method called "balanced-count". This method is another possible value for `CacheSchedulingConfig::strategy`.

The "balanced-count" method selects the read node with the fewest assigned shards and allocates the next shard to that node.

You will ignore all read nodes which are in blocklist, that is you can use only read nodes from `get_readers_for_schedule`.

You still need to respect `allocate_parallelism`.

### Clarifications

- "assigned shards" means the count of entries in `ReaderNodeMeta::allocated_shards` (includes both warming and ready shards).
- If multiple reader nodes tie for the fewest assigned shards, you can pick any of them.
- Respect `allocate_parallelism` by relying on the existing per-reader `warmup_sem` rate limiting; no extra pre-check in the scheduler is required.
- For `get_readers_for_schedule`, you must simulate both blocklist and expired readers in tests.

### Musts

- Ask me if you don't understand any part of this task. You don't make decisions on your own.
- You must follow the programming style defined in `STYLE.md`.

### Tests

- You must implement tests to ensure that the "Musts" are met.
- You must follow the "Testing Guidelines" in `AGENTS.md`.
- You have to implement a series of tests in `src/meta/reader/shard_cache/manager.rs`. These tests must cover `allocate_parallelism` and `get_readers_for_schedule`.
- You run test with `export CARGO_TARGET_DIR=./target-codex`.


