Prerequisite to #1798
## Changes
* Pass the final `TickNumber` count as a member of `Won` constructor so that it can be used in scoring submitted solutions
* Extract a helper function `codeMetricsFromSyntax` that can be reused by tournament server
* `ToJSON` instance for `ScenarioMetadata`
* New script `list-sublibraries.sh` to list the sublibraries defined in a package
In support of #1598 (for #1739).
Runs the `idle` benchmark for many more ticks and with many more robots to try to emphasize the effect of regressions and mitigate jitter.
Also factors out common code from the `benchmark-against-parent.sh` script.
Closes#795
![image](https://user-images.githubusercontent.com/261693/210162423-4dadf9d8-8e32-437f-b854-b7106dd4bbe8.png)
![Screenshot from 2022-12-31 22-58-59](https://user-images.githubusercontent.com/261693/210163446-e53c4abd-7bc1-4271-8a7c-cf0165f9ced8.png)
![image](https://user-images.githubusercontent.com/261693/210162466-3d3ae29e-9b35-44e6-93bc-df1efe59d7e9.png)
## Tasks
- [x] Vendor a subset of the `boolexpr` package
- [x] New display logic for parallel goals
- [x] Add a check for whether winning is impossible (due to a "not" prerequisite being achieved)
- [x] Add a "Lose" dialog analogous to the "Win" dialog
- [x] Validate no dependency cycles in prerequisites specs
- [x] Add tests for negative validation result from scenario parsing
- [x] Web API to inspect status of incomplete, completed, optional, and prerequisite objectives
- [x] Update all of the multi-goal scenarios to use prerequisites
## For follow-up PRs:
- [ ] Upload new GHC8-compatible version of `boolexpr` to Hackage (perhaps [take over the package](https://wiki.haskell.org/Taking_over_a_package)?)
- [ ] Add prerequisites and its logical operators to JSON schema
- [ ] Reverse topological sort of goals before evaluation, with a test that demonstrates necessity
- [ ] Automatically skip over the header rows when navigating the Goals list
- [ ] Add indicators for optional and hidden goals
- [ ] New Challenge for strategizing optional and mutually-exclusive goals
Closes#936.
With this change, `stack build` should be invoked as normal, but to run tests one should invoke the new script, which will place compilation artifacts in a separate directory so as to not stomp on the previous `stack build` artifacts.
## Demo
```
stack build
./scripts/run-tests.sh
stack build
```
All perform incremental compilation rather than from-scratch.
- allow HLS to use Cabal instead of Stack
- Cabal works fine, and I do not see any advantage to using Stack
- someone using Stack should test this does not switch him to Cabal ⚠️
- ignore `cabal.project.local` so I can put there `ghc-options: -haddock`
- this flag could lead to errors before GHC 9, but it gives me [docs on hover](https://haskell-language-server.readthedocs.io/en/latest/features.html)