Repository navigation
perf(results): reconcile independent diagnostics with local indexes - #761
Conversation
Keep local membership sets while restoring independent errors and warnings. Preserve their order, existing finding multiplicity, gate failures, summary counts and the option to retain repeated warnings. Signed-off-by: Afloat <ShuffleMonkey@163.com>
Resolve the Unreleased changelog insertion while preserving exactly this pull request's code, tests, and release note against current main. Signed-off-by: Afloat <ShuffleMonkey@163.com>
rng1995
left a comment
There was a problem hiding this comment.
Thanks for your contribution, @Afloat16. Reviewed 024be56715d1; no actionable defects found in the changed code.
Focused validation: 1,572 model, policy and security tests passed.
Hosted CI is still awaiting authorization or completion; this is a code-review approval, and does not certify a full hosted CI pass.
chrisknvidia
left a comment
There was a problem hiding this comment.
Thanks. Independently confirmed: 2,500 seeded scenarios through the real apply_policy and dedup consumers produce byte-identical results with order preserved, a crafted --policy run is identical on both trees, and 20k items go from about 4 s to 12 ms. The open P3 about the new tests also passing on main stands; one test that fails against the old restoration loop would make this safer to keep.
Merge current main and preserve the published release history. Signed-off-by: Afloat <ShuffleMonkey@163.com>
Keep both release-note entries and preserve the existing PR implementation and regression tests. Signed-off-by: Afloat <ShuffleMonkey@163.com>
Summary
After a severity change or scanner finding deduplication,
recalculate_keeping_independent()rebuilds the finding-derived state and restores independent diagnostic lines. It checks every candidate against the growing error or warning list. Large collections of independent diagnostics therefore make this restoration quadratic.Use local membership sets for the restoration checks. The output lists retain their order and any repeated lines already produced by findings. Gate errors remain once, and
keep_repeated_warnings=Truestill appends every supplied warning. Sets live only for one rebuild, so later mutations cannot leave a stale index.Related changes in #564 introduced the shared reconciliation behavior. This change preserves that behavior and speeds its real scanner and policy consumers. The separate reporting-summary occurrence merge from #739 is unchanged.
Measurement
Python 3.12.14, one warm-up and the median of three timed calls per scenario. Each fixture has the stated number of independent errors and independent warnings; fixture construction and output serialization are outside the timed region. Scanner deduplication receives two repeated findings; the policy case lowers one finding on an incomplete scan.
All six complete serialized result hashes match before and after. The baseline model and consumer implementations are identical at
d2cb138andcbda65c1. These local measurements demonstrate the removed repeated scans, not a production latency guarantee.Verification
Ten new compatibility cases pass both before and after: all combinations of incomplete state and retention options, existing finding multiplicity, gate/error overlap, first-seen ordering, input independence, real scanner deduplication and a real policy override.
Result, policy, diagnostic and finding-verification tests — 108 passed.
Security consumer selection (
dedup or llm_verdict or llm_verification) — 18 passed, 1,468 deselected.Full lint, changed-file formatting and
git diff --check— passed.Wheel and sdist builds — passed.
I am familiar with the Contributing Guidelines
Added or updated focused tests
Updated documentation for user-visible changes (Unreleased changelog)
Ran
make lintequivalent:python -m ruff check src testsFull
make testdid not complete successfully in this environment (see below)Ran
make buildequivalent:python -m buildDid not add credentials, private datasets, or proprietary benchmark content
The earlier full-suite attempt stops on unchanged base
d2cb138intest_gitlab_enriched_tier1_applies_the_keyless_job_baselines: its shell fixture hard-codesmktemp -d /tmp/..., while this workspace has no/tmp. That base run reached 456 passed, 2 skipped and 19 deselected before the failure.Release Impact
CHANGELOG.md