synology_apm_repo.sdk.dedup.verify_report module¶
Grouping and a stable render order for a batch of Findings from one
Repository.verify()/Catalog.verify() run — the presentation-adjacent
logic that turns a flat list into “same root cause” groups, shared by every
frontend that lists Findings this way (the CLI’s own verify
command and the TUI’s own diagnostics screen both use it).
Kept here, next to verify_checks.py’s own Finding/Stage/
Symptom definitions, rather than in presentation/ — that package is
a true leaf with zero internal imports of its own (see ARCHITECTURE.md’s
Presentation section), and this module needs Finding, which lives one
layer up, in dedup.
- synology_apm_repo.sdk.dedup.verify_report.sort_key(finding)¶
A stable, deterministic order for a batch of
Findings: chronological (by the version-display-name timestamp embedded inpath) for a genuine per-version finding, alphabetical by wholepathfor everything else (RepoInfo/FileMap/Composition/EncryptKey, a Bucket finding not tied to one version, and aStage.VERSIONfinding that isn’t per-version either — a connection/workload enumeration failure or a PC/PS per-disk failure, neither of which ends in a timestamp). Also what makes--level full’s own multiprocess bucket sweep produce a stable order despite not otherwise guaranteeing one.
- class synology_apm_repo.sdk.dedup.verify_report.AugmentedFinding(finding, ref_value, template, variable_parts)¶
Bases:
objectOne
Findingplus the ref/template/variable-parts signalgroup_findings’s own grouping and every caller’s rendering both need, computed once here rather than independently re-derived once per consumer (once during grouping, again per group representative at render time).- Variables:
finding (synology_apm_repo.sdk.dedup.verify_checks.Finding) – The underlying
Finding.ref_value (str | None) – This finding’s own embedded
[ref=...]value, orNonefor the minority of raise sites that never attach one (units/fs.py,units/saas/objectdb.py).template (str) –
finding.detailwith its instance-specific values placeholdered away, keeping an embedded[ref=...]tag visible exactly whenref_valueis notNone— this onekeep_refchoice is what lets a single field serve bothgroup_findings’s ownref_value is Nonefallback discriminator and a group header’s own display, which wants the ref tag kept visible when there is one.variable_parts (str) – The instance-specific values
templatereplaced, in order, joined for display under a group’s shared header — the part offinding.detailthat still differs per instance, withref_valueitself omitted (the header already shows it once).
- synology_apm_repo.sdk.dedup.verify_report.group_findings(findings)¶
Buckets
findings(expected already sorted bysort_key) by_group_key— findings that resolve to the same key (the sameref, or the same normalized-template fallback) land in the same group. Groups themselves are then sorted by that same key (stage, then symptom, then the ref/template discriminator itself) rather than left in first-member-encountered order: two groups sharing a stage and symptom otherwise interleave by whichever member happened to sort chronologically first, which — for a SaaS stream’s own sequentialrefvalues — can put e.g..../1/16/saas_objahead of.../1/14/saas_objmerely because one workload’s display name happens to sort before the other’s. Sorting groups by their own ref/template value directly avoids that, at the cost of no longer being purely chronological across groups (each group’s own members stay chronological either way, unaffected by this).- Returns:
Each finding wrapped in its own
AugmentedFinding, so the ref/template/variable-parts signal is computed once here instead of being re-derived independently by each caller that renders these groups.- Return type:
- synology_apm_repo.sdk.dedup.verify_report.group_count_label(group)¶
"<N> version(s)"for a per-versionStage.VERSIONgroup, else"<N> occurrence(s)"— the pluralized member-count label everygroup_findingsrenderer shows under a group’s own header.