4d40b30c

Created Started Finished

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Cut the file in the checker, and only a file it has read

The splitting was `head` and `tail` in a shell, working from a line number the
checker would hand out for the asking. Two things wrong with that.

`--redeployable-line` did not check anything. It computed the boundary and
said nothing about the file, so a caller could cut a configuration nobody had
ever read and deploy the halves. That the one caller happened to pass a checked
file was a convention in another repository, not something this one enforced.

And rejoining a file is not the same as never having taken it apart. `head` and
`tail` happen to be exact here; the shell around them was where a trailing
newline would go missing, which is why it needed a `cmp` afterwards to say so.

So `--split-into DIR SCRIPT HOSTS_JSON` replaces it: every check first, the
halves only out the other side of that, cut on the text at the offset after the
right newline rather than on a list of lines, and asserted to concatenate back
into what they came from. The only way to get halves is a run that also
checked, so a deployment built on halves is a deployment of a file that has
been read.

The boundary itself says nothing about why it is missing, because a file with
no way back in is already one of the things checked for, and reporting it twice
reported it twice: eight problems for a file with four.