synology_apm_repo.sdk.storage.seqid module

Sequence-id resolution (FORMAT-SPEC.md: sequence-id-suffix) — “take the largest .<N> suffix, a bare name is also valid” — for .buk, c<subID>, .inf, .fgp, .ref, and similar per-generation files.

synology_apm_repo.sdk.storage.seqid.resolve_seq_file(dir_index, logical_name, *, ref=None)

Resolve logical_name to the physical file name carrying the largest numeric sequence-id suffix, given a {logical_name: [physical_names]} index (DirCache.grouped).

A bare, unsuffixed name is a valid candidate and wins if no suffixed variant exists.

async synology_apm_repo.sdk.storage.seqid.resolve_seq_path(dir_cache, dir_path, logical_name)

resolve_seq_file, plus the dir_cache.grouped() lookup and dir_path/physical-name join around it — the shared shape behind every “resolve one .<N>-suffixed per-generation file inside a known directory” call site (dedup/repository.py, dedup/verify_checks.py, dedup/pool/__init__.py, dedup/fingerprint.py, dedup/composition_reader.py). Each caller still builds its own dir_path/logical_name split (layer paths split differently — see e.g. dedup/pool/__init__.py’s own bucket_path); this only covers the three lines common past that point.

Not for units/saas/stream.py’s own _resolve_db_path, which looks similar but has a genuine extra rule (preferring the un-suffixed live file) this doesn’t implement.