pub fn result_archive_path(
entry: &str,
service_name: &str,
sandbox_id: Option<i32>,
) -> Option<PathBuf>Expand description
The single source of truth for where a service’s result archive lives, given a task’s source
entry. The sink writes it here and the frontend reads it back from here — previously three
call sites re-derived the same <entry-dir>/<service>.zip three different ways (a
Path::parent and two subtly-different regexes), so this collapses them into one.
sandbox_id carries the F-6 fix: a sandbox corpus shares the parent’s source entry paths
in place (owner decision: no source copy), so keying its outputs on entry alone would let a
sandbox rerun overwrite the parent’s archives. When Some(id) (the sandbox’s own corpus id) the
archive is name-scoped — <entry-dir>/<service>.sandbox-<id>.zip — so a sandbox’s outputs never
collide with the parent’s (or another sandbox’s). None keeps the historical
<entry-dir>/<service>.zip for ordinary corpora (backward-compatible with existing archives).
Returns None if entry has no parent directory (a malformed/relative entry) — the caller then
has no result path to write or serve.