Implement useState(initial) returning [get, setState] where setState
accepts either a new value OR an updater function (prev) => next.
solve(initial, ops) drives state and returns history.
Op: { type: 'set', value } or { type: 'update', fn: '<source>' } (source eval'd).
Sample tests