⭐ show assessments inside of blocks #5247
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This has been a very long time coming. Despite being an important step forward, it's also only just the first step in terms of the code changes that will be necessary to clean this up long-term.
So, ...
What is this?
Currently if we run this:
It shows us what's up.
But what if we put it inside a block?
Darn, all the useful output just disappeared.
This PR make it so that instead we get:
This example is a bit constructed, but works just as well with naturally occurring blocks like:
TODO
Fixes #5246
How does it work?
This is where things get a bit tricky, because this PR is only a first step to solve the problem, but ultimately needs follow-ups to increase clarity.
1: Expand Code Bundles
By default, code bundles don't need to translate from CodeIDs into refs. This only ever becomes useful when we print things and deal with CodeIDs and try to go back to the compiled code (CodeBundle) and figure out how best to render it. We add a type that is only used for printing so we don't need to extend the CodeBundle for this task (no foreseeable future where we'd ever want to transmit this data, ie not part of proto).
2: Start to building assessments inside the data printer
Printing is currently split up in an assessment and a data-printing phase. If something is handled in the assessment phase it will be printed as an assessment and that's it. If not, it will be printed as data.
When we receive an outer block, it switches into data mode. However, the block may contain assertions, that are then ignored and never collected nor printed. This PR changes this behavior and starts to look for assertions inside of blocks.
3. Start to collect datapoints inside of blocks
An old piece of code had previously removed this:
Looks like we are far past that point, so let's start collecting.