[ty] Share constraints in retained sequent maps (#28966)
## Summary
Cached sequent queries retain repeated copies of constraints in their
keys and results, and cached maps retain state needed only during
construction.
We now intern constraints across query keys and results, keep
builder-only state out of the cached maps, and box grouped-sequent
metadata so ungrouped entries are smaller. Sequent ordering is
preserved.