Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ad82f63
feat(reporting): reconcile stable finding IDs across report formats
rng1995 Oct 30, 2026
7131ab7
Merge main into naren/port-stable-finding-ids
rng1995 Nov 2, 2026
6bd6dcc
fix(ci): refresh finding IDs even when no credential token was collected
rng1995 Nov 2, 2026
380bef2
fix(models): keep finding_id stable when a message repeats its location
rng1995 Nov 2, 2026
c3db20f
fix(reporting): count each location a folded PII finding lists
rng1995 Nov 2, 2026
39b3c78
fix(reporting): do not count workflow scope notes as warnings without…
rng1995 Nov 2, 2026
390980f
fix(reporting): merge HTML skill entries only within one finding_id
rng1995 Nov 2, 2026
0de9945
test(reporting): pin path separators, missing lines and severity esca…
rng1995 Nov 2, 2026
04454d1
docs: note that HTML summary.total_issues now counts unique findings
rng1995 Nov 2, 2026
139fd23
Merge main into naren/port-stable-finding-ids
rng1995 Nov 3, 2026
b8ef88e
fix(reporting): keep folder and plugin locations consistent in findin…
rng1995 Nov 3, 2026
9260978
refactor(reporting): drop the unused advisory_results list
rng1995 Nov 3, 2026
d7bd2b1
fix(reporting): prefix folded PII locations in merged results; trim o…
rng1995 Nov 3, 2026
b025f7e
Merge origin/naren/port-stable-finding-ids into naren/port-stable-fin…
rng1995 Nov 3, 2026
6c495f1
Merge main into naren/port-stable-finding-ids
rng1995 Nov 3, 2026
5c4d0c6
fix(ci): render the redacted HTML report from the refreshed JSON
rng1995 Nov 3, 2026
adad33d
fix(models): match a Windows message location against a posix file path
rng1995 Nov 3, 2026
ddc8b92
Merge main into naren/port-stable-finding-ids
rng1995 Nov 3, 2026
407455b
Merge origin/main into naren/port-stable-finding-ids
rng1995 Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ All notable changes to SkillEvaluator are documented in this file.
`skillevaluator-tier1.json` and do not embed a second copy of the report
JSON. Standalone CLI HTML reports embed it for Export JSON.

- Every finding now has stable IDs for tracking across runs and validators.
`finding_id` (`SEF-…`) is derived from the finding's category, check,
message, and suggestion, so it survives line moves, whitespace or case
changes, and severity overrides; `occurrence_id` (`SEO-…`) adds the file,
line, and line content. Identical findings in different files or skills
share one `finding_id`, so they count as one unique finding with one
occurrence per location. When CI redacts a detected credential from a
report, it recomputes the IDs from the redacted text, so no ID is derived
from a removed value. The JSON report and the HTML report's embedded data
add `finding_counts` (raw records, distinct occurrences, unique findings,
and duplicates removed), `finding_groups` (each unique finding with its
validators and every location), and `message_counts` (error and warning
strings with no finding behind them, such as failed gates and scanner or
execution errors, plus informational messages other than the `[OK]` line
recorded for each passed check); each JSON result also carries its own
`finding_counts`. Markdown adds a Finding Reconciliation table, most severe
first, and per-finding IDs. `total_errors`, `total_warnings`, and
`severity_counts` are unchanged.

### Changed

- Hosted GitHub reports verify a separate GitHub-signed execution receipt.
Expand Down Expand Up @@ -143,6 +162,21 @@ All notable changes to SkillEvaluator are documented in this file.
environment, so each template compiles once per process instead of once per
report.

- The Markdown summary and the HTML report's summary now count findings the
same way: each unique finding once, at its highest severity, however many
lines, files, skills or validators report it. Markdown's Total Issues adds
distinct occurrences, raw records, and errors and warnings with no finding
behind them, such as failed gates and incomplete scans; its severity
breakdown counts unique findings. In HTML, the tier cards, the Tier 1
Findings and Blocking critical + high numbers, the verdict sentence, the
skill finding badges and the gate policy line count unique findings, and
the Findings number shows the same occurrence, raw-record and no-finding
counts beneath it when they differ from the unique count. Both formats used
to add up raw records, so a finding reported on several lines or by two
validators counted more than once. The JSON `skills[].issue_count`,
contributor totals, `total_errors`, `total_warnings` and `severity_counts`
still count raw records.
Comment thread
rng1995 marked this conversation as resolved.
Resolved

### Documentation

- Give the performance dashboard its own sidebar guide, retain the previous
Expand Down
6 changes: 6 additions & 0 deletions ci/publish_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ def read_artifact(payload: bytes) -> tuple[dict, dict[str, dict]]:
redactor = Redactor(tokens)
summary = redactor.object(summary)
reports = redactor.object(reports)
if tokens:
from skillevaluator.reporting.finding_summary import refresh_finding_identities

# IDs hashed from the unredacted text could confirm a guessed value.
for report in reports.values():
refresh_finding_identities(report)
validate_summary(summary)
for row in summary["skills"]:
if row["overall_status"] != "error":
Expand Down
4 changes: 4 additions & 0 deletions ci/secret_redaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pathlib import Path

from skillevaluator.reporting import MarkdownReporter, SARIFReporter
from skillevaluator.reporting.finding_summary import refresh_finding_identities
from skillevaluator.reporting.retained import retained_results
from skillevaluator.utils.secret_redaction import SENSITIVE_PII_CATEGORIES, Redactor, sensitive_values
from skillevaluator.utils.secure_fs import SecureRoot
Expand Down Expand Up @@ -148,6 +149,9 @@ def sanitized_outputs(raw: Path, tokens: set[str]) -> dict[str, bytes]:
text = content.decode("utf-8")
if name.endswith(".json"):
document = redactor.object(json.loads(text))
if tokens and isinstance(document, dict):
Comment thread
rng1995 marked this conversation as resolved.
Resolved
# IDs hashed from the unredacted text could confirm a guessed value.
refresh_finding_identities(document)
text = json.dumps(document, ensure_ascii=True, allow_nan=False, indent=2)
else:
text = redactor.text(text)
Expand Down
34 changes: 32 additions & 2 deletions docs/ci-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,40 @@ When the exit code is not enough — dashboards, custom thresholds, badge genera
| `results[].publication_evidence` | object | Validated built-in Tier 1 or Tier 2 producer contract: schema version, producer, tier, and canonical check ID |
| `tier3.run_id` | string | Run-owned Tier 3 identity; duplicated in the Tier 3 summary for consistency checks |
| `severity_counts` | object | Totals for `critical`, `high`, `medium`, `low` |
| `total_errors`, `total_warnings` | number | Aggregate counts across all validators |
| `skills` | array | Per-skill `{ name, passed, issue_count }` |
| `total_errors`, `total_warnings` | number | Raw error and warning records across all validators; a finding that two validators report counts twice |
| `finding_counts` | object | Reconciled counts: `raw_occurrences`, `distinct_occurrences`, `unique_findings`, `duplicates_removed`, `occurrences_grouped`, `raw_by_severity`, `unique_by_severity` |
| `finding_groups` | array | One entry per unique finding: `finding_id`, highest `severity`, `message`, `validators`, and every location in `occurrences[]` with its `occurrence_id` |
| `message_counts` | object | `independent_errors` and `independent_warnings`: error and warning strings with no finding behind them, such as `gate_failures` and scanner or execution errors (strings that mirror a finding are not counted); `informational`: informational messages, not counting the `[OK]` line recorded for each passed check |
| `results[].findings[].finding_id`, `results[].findings[].occurrence_id` | string | Stable finding and location identities (see below) |
| `skills` | array | Per-skill `{ name, passed, issue_count }`; `issue_count` counts raw finding records |
| `quality_summary` | array | Quality details with `overall_score` (0–100) and `grade` (A–F); a folder target reports the collection average plus a `skill_count` |

Every finding carries two stable IDs. `finding_id` (`SEF-` plus 20 hex
characters) hashes the finding's category, check name, message, and suggestion,
ignoring case and extra whitespace. It does not change when the finding moves
Comment thread
rng1995 marked this conversation as resolved.
Resolved
to another line or file, or when a policy changes its severity, so you can
track a finding across runs. `occurrence_id` (`SEO-…`) adds the file path,
line number, and line content, so it identifies one location.
`finding_groups` groups findings by `finding_id` across validators, and each
result in `results[]` carries its own `finding_counts`. Identical findings in
different files or skills share one `finding_id`, so they count as one unique
finding with one occurrence per location. When the CI templates redact a
detected credential from a report, they recompute the IDs and groups from the
redacted text, so no ID is derived from a removed value; such a finding's IDs
differ from a local run's.

The Markdown summary and the HTML report count findings the same way: each
unique finding once, at its highest severity. Markdown's Total Issues also
shows distinct occurrences, raw records, and the `independent_errors` and
`independent_warnings`, so a run that fails a gate or leaves a scan
incomplete without any finding is not reported as zero issues. In HTML, the
tier cards, the Tier 1 Findings and Blocking critical + high numbers, the
verdict sentence, the skill finding badges and the gate policy line count
unique findings, and the Findings number shows the same breakdown beneath it
when it differs from the unique count. `total_errors`, `total_warnings`,
`severity_counts`, `skills[].issue_count` and contributor totals still count
raw records.

`overall_status` and `overall_passed` describe the configured command gate. They
can be green when an advisory tier did not run, so do not use them as a
publication signal. Require `publication_status == "pass"` (or
Expand Down
13 changes: 9 additions & 4 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ the evidence below it:
repeat a finding are folded away.
- **Run details.** Scope, the target path, provenance and the gate policy.

A finding is one problem a check reports at one location, with a severity. A
finding in a failed check blocks the verdict; a finding in a passed check is
advisory. A quality score below the configured minimum fails the Quality score
check, so it also blocks the verdict.
A finding is one problem a check reports, with a severity. The same problem
reported on several lines, or in several files or skills, counts once at its
highest severity; each location is an occurrence. When the counts differ, the
findings number shows the occurrences, the raw records and any errors or
warnings with no finding behind them beneath it, in the same words as the
Markdown report's Total Issues. A finding in a failed check blocks the
verdict; a finding in a passed check is advisory. A quality score below the
configured minimum fails the Quality score check, so it also blocks the
verdict.

The HTML report, the CI index and the Pages history use the same verdict
words: **Passed**, **Changes required**, **Incomplete**, **Skipped** and
Expand Down
42 changes: 42 additions & 0 deletions src/skillevaluator/models/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from __future__ import annotations

import hashlib
from dataclasses import dataclass, field
from enum import StrEnum

Expand Down Expand Up @@ -129,6 +130,45 @@ def tag(self) -> str:
return f"[{self.category}-{self.severity.value.upper()}]"
return f"[{self.category}-{str(self.severity).upper()}]"

@staticmethod
def _normalize_identity_text(value: object) -> str:
"""Normalize human text without coupling identity to formatting."""
return " ".join(("" if value is None else str(value)).casefold().split())

@property
def finding_id(self) -> str:
"""Return a deterministic semantic identity independent of location.

File and line belong to an occurrence. Excluding them lets reporters
group the same check across paths and validators while retaining every
concrete occurrence in the reconciliation contract. Severity is also
excluded, so a policy override or verifier downgrade keeps the ID.
"""
identity = "\x1f".join(
(
self._normalize_identity_text(self.category),
self._normalize_identity_text(self.check_name),
self._normalize_identity_text(self.message),
self._normalize_identity_text(self.suggestion),
)
)
digest = hashlib.sha256(identity.encode("utf-8"), usedforsecurity=False).hexdigest()[:20]
return f"SEF-{digest}"

@property
def occurrence_id(self) -> str:
"""Return a deterministic identity for this concrete location."""
identity = "\x1f".join(
(
self.finding_id,
("" if self.file_path is None else str(self.file_path)).replace("\\", "/"),
Comment thread
rng1995 marked this conversation as resolved.
Resolved
str(self.line_number) if self.line_number is not None else "",
self._normalize_identity_text(self.line_content),
)
)
digest = hashlib.sha256(identity.encode("utf-8"), usedforsecurity=False).hexdigest()[:20]
return f"SEO-{digest}"

@property
def location(self) -> str:
"""Return formatted location like 'file.py:42'."""
Expand All @@ -145,6 +185,8 @@ def to_dict(self) -> dict:
"""Convert to dictionary for JSON serialization."""
severity_value = self.severity.value if isinstance(self.severity, Severity) else str(self.severity).lower()
return {
"finding_id": self.finding_id,
"occurrence_id": self.occurrence_id,
"category": self.category,
"severity": severity_value,
"check_name": self.check_name,
Expand Down
Loading
Loading