Under FailurePolicy.ContinueOnError, stageSplitPackages can skip a
sub-package that failed to stage and still return successfully (the
error is only recorded via split_staging_errors_encountered).
restoreOrStageSplitPackages unconditionally persisted that result to
the build cache regardless of the error flag. On a later rebuild with
unchanged inputs, this became a cache hit that silently restored the
same incomplete package set while reporting success, and the
cache-hit path unconditionally cleared split_staging_errors_encountered
on top of that.
Fix by skipping the persist call whenever split_staging_errors_encountered
is set, so an incomplete split-stage result is never cached and a
rebuild with the same inputs genuinely re-stages instead of silently
reusing a stale partial result.
Add a regression test that stages two packages with identical inputs
across two calls to restoreOrStageSplitPackages, forcing one package to
fail on the first call only. Verified the test fails without the fix
(the second call restores the cached 1-package result instead of
re-staging both) and passes with it.