fix(run): the dry run's re-slice reads the line prefix to its bar

The re-slice self-check stripped six characters off every inlined
artifact line - `0001| ` - and so failed from line 10000 on, where the
number has five digits. The prefix is read to its bar now; a test
freezes a 10,050-line file and dry-runs it.
This commit is contained in:
Jorijn van der Graaf 2026-11-01 01:31:40 +01:00
commit 0e0983f278
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
2 changed files with 55 additions and 1 deletions

View file

@ -2241,7 +2241,11 @@ namespace Crafter::Review::Run {
const std::string after = runLayer.substr(at + marker.size());
const std::string body = after.substr(0, after.find("\n\nINVENTORY - "));
const std::vector<std::string> artLines = Dyn::Split(body, "\n");
for (std::size_t i = 1; i < artLines.size(); ++i) art.push_back(Dyn::Slice(artLines[i], 6));
// The line number prefix (`0001| `, five digits from line 10000 on - the self-review of 2026-11-01 found the fixed width).
for (std::size_t i = 1; i < artLines.size(); ++i) {
const std::size_t bar = artLines[i].find("| ");
art.push_back(bar == std::string::npos ? artLines[i] : artLines[i].substr(bar + 2));
}
}
for (const Json& u : units) {
const Json& range = u.at("lines");