Repository navigation
fix(tier1): scope ownership email policy and retain completeness diagnostics - #333
Conversation
Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Christopher Kevin <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 2 findings (0 P1, 0 P2, 2 P3); 2 posted inline.
Checked the ownership-span classification and PII scan path, the SkillSpector completeness diagnostics (scan stages, folder aggregation, policy recalculation, JSON/retained round trips), and the CHANGELOG/docs claims, with base-vs-head CLI probes for validate --policy, tier1 --policy, nested manifests and faked partial SkillSpector reports.
Tests on this head: test_pii_ownership + test_skillspector_diagnostics 42 passed; security, PII grouping, policy, security validators, private static reports, retained HTML and SkillSpector provenance 826 passed, 1 skipped; scan-incomplete, reporters, CLI surface golden and run_tier1 272 passed; ruff clean on the changed files.
Merge with main needs a real rebase (the branch is 49 commits behind): CHANGELOG.md, docs/cli-reference.mdx, src/skillevaluator/cli.py and src/skillevaluator/validators/security.py conflict. Main added --pii-waivers/waive= in the same option block, PII call and imports, and moved the incomplete-scan message into _skillspector_incomplete_analysis_error, so the "Details:" suffix has to be re-applied there.
As the branch stands, the CHANGELOG entry merges into the released 0.8.0 section; it needs to move back under Unreleased.
No file conflicts with the other open PRs in this round; once the entry moves to Unreleased it will conflict with them in CHANGELOG.md only. No semantic overlaps found.
…s and summarize affected artifacts (#460) * feat(tier1): name SkillSpector AE1 findings and say why each file was not inspected SkillSpector reports a High AE1 (incomplete referenced artifact analysis) finding at each line that names a file it did not completely inspect. The finding said only "Referenced artifact was not completely inspected", so the reason had to be matched by hand against the incomplete-analysis error. With SkillSpector before v2.12.0 it was titled "Unknown (AE1)" and suggested making the file available although SkillSpector had read part of it. The new skillspector_references module projects the finding's evidence: the target, its disposition and up to 16 reasons, read from the ledger rows of earlier releases, with bounded, redacted text and paths kept only inside the scan. The suggestion names the file and each reason, and the result counts the files and reference lines in skillspector_reference_summary and one message, also across the --llm stage and a folder of skills. Severities, completeness and gates are unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(reporting): count incompletely inspected referenced files in failed Tier 1 reports When the security check fails, the full and compact terminal output, the Markdown report and the HTML report add one line that counts the files SkillSpector did not completely inspect and the lines that name them. The JSON report records the counts in skillspector_reference_summary, with only its three count fields. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): describe the reasons and counts of SkillSpector AE1 findings Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): drop AE1 reason limits too large for a float A reason's limit that is an integer beyond the float range raised OverflowError in math.isfinite, so the scan returned no result. Check the type and range first and call math.isfinite only for floats, so such a limit is left out like any other out-of-range value. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the AE1 count line out of passing results The count of incompletely inspected referenced artifacts was also added to the result's messages. A policy that lowers the AE1 findings, or --verify-llm, can pass a complete scan, and reporters list a passing result's messages as passed checks, so the Markdown, HTML and terminal reports showed the count as a success. Every reporter already renders the line from the skillspector_reference_summary metadata, and only for a failed result, so the message is dropped. JSON still records the counts for every result. Also pin that a severity override for a SkillSpector report before v2.12.0 matches the rule's name, not "Unknown (AE1)". Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(tier1): normalize each AE1 path and text once per SkillSpector report Every reference line and reason of every AE1 finding went through redaction, and every absolute path resolved the scan root again. A report with thousands of AE1 findings that repeat the same lines took seconds instead of a fraction of one. ReportNormalizer keeps, for one report, the redacted form of each distinct text and the in-scan form of each distinct path, and resolves the scan root at most once. _process_skillspector_cli_result builds one and passes it to the ledger index and to every issue it converts. report_path keeps its behavior for a single path. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(reporting): prefix AE1 reference lines with their skill in folder results merge_with_prefix put the skill's [name] prefix on each finding's path and on the PII scan's metadata occurrences, but not on the skillspector_occurrences of an AE1 finding. In a folder report a JSON reader could not tell which skill a listed reference line was in without the finding's own path. Prefix those lines the same way; the referenced file's target_path stays relative to the named skill. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(reporting): say the AE1 count line names any reasons SkillSpector gave The count line ended "each AE1 finding names the artifact and why its analysis stopped", but a finding counts whenever SkillSpector names its file, even with an empty reason list and no ledger row for the file. Say instead that each finding names the artifact and any reasons SkillSpector gave. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(reporting): import the AE1 count formatter where cli and markdown use it The module-level imports in reporting/cli.py and reporting/markdown.py sat in the same import slot that several open pull requests also add to, so each of those merges would conflict on one line. Import reference_summary_message inside the method that uses it, as html.py already does. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): note the AE1 check-name change for severity overrides With SkillSpector before v2.12.0 the AE1 check name changes from "Unknown (AE1)" to "Incomplete referenced artifact analysis (AE1)", so a severity_overrides entry keyed on the old name no longer matches and the SARIF rule ID changes. Say so in the CHANGELOG and the Tier 1 docs, and soften "gates are unchanged" to the one case where a gate can change. Also say that JSON records the counts for every result, while the other reports show them only for a failed one. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(reporting): register the AE1 count filter first in the HTML environment Two sibling port branches add a filter after skip_reason, where this branch also added one, so each merge conflicted on one line. Register skillspector_reference_summary before the other filters instead. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the measured run time out of AE1 suggestions A finding's suggestion is part of its finding_id, which the docs say stays the same across runs. The AE1 suggestion listed every limit of a reason, including observed_seconds, the wall-clock time SkillSpector records with a runtime_limit reason. Each run of a scan that hit the runtime budget gave the finding a new finding_id, and with --llm the two stages' copies of one reference line counted as two unique findings when the second stage was incomplete. The suggestion now leaves out observed_seconds; the finding's metadata still records it. Reasons that differ only in the run time are described once. The CHANGELOG notes that AE1 finding_id values change once because the suggestion text is new. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(reporting): keep the AE1 count line in reports rendered from retained JSON CI renders its HTML and Markdown reports again from the JSON report through retained_results, which rebuilds each result's metadata from named fields. skillspector_reference_summary was not one of them, so a failed Tier 1 result lost the count line in every report that CI published, although the docs and the CHANGELOG say the Markdown and HTML reports show it. retained_results now copies the record through reference_summary_record, so only valid counts are kept and a malformed record is dropped. The hunk sits after the scanners block, apart from the lines that open PRs #333 and #349 change in this function. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier1): keep the time budget out of AE1 suggestions SkillSpector sets a runtime_limit reason's limit_seconds to the part of the scan's time budget left when the step began: for each file that YARA did not reach and for the dependency analysis of a lockfile. The value differs from run to run like observed_seconds, so an AE1 finding with such a reason got a new finding_id on every run. Leave every *_seconds limit out of the suggestion and its grouping key. The finding's metadata keeps both values. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier1): say beside the counters that AE1 counts are totaled like them The sentence on the AE1 counts followed the paragraph on reference and target roots, so "the same way" read as the target-root rule. It now sits in the paragraph on the applicability counters. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
The PII scan walks the whole skill tree, so a SKILL.md nested under references/ or scripts/ could declare metadata.pic or metadata.email and have its address classified as an ownership contact. With PII.ownership_emails set to info, that address stopped blocking. Pass the scanned skill directory into the per-file scan and only look for ownership spans in the manifest that sits directly in it. Nested manifests keep the ordinary email policy. Clarify this in the Tier 1 docs. Signed-off-by: Christopher Kevin <[email protected]>
Resolve the conflicts with the PII waiver, SkillSpector reference-caveat and profile changes on main: - Keep both the ownership-contact spans and the waiver callback in the PII scan signatures and calls. - Report incomplete SkillSpector analysis with main's message, which now lists the incomplete files, and keep recording the bounded completeness diagnostics as a gate failure. Drop completeness_details, which that message replaces. - Keep --pii-waivers and main's --profile wording next to --policy. Signed-off-by: Christopher Kevin <[email protected]>
Keep this PR's changelog entries on top of main's and add an upgrade note: a PII.emails override in --policy no longer reaches SKILL.md ownership contacts, which now report as PII.ownership_emails. Signed-off-by: Christopher Kevin <[email protected]>
When analysis_completeness lists limitations but no ledger exceptions, the error had no reason for stopping. Append the first limitation to it. Signed-off-by: Christopher Kevin <[email protected]>
Summary
Fixes #331.
Separate intentional ownership contacts from ordinary email findings, and retain the reasons that SkillSpector could not complete a scan.
SKILL.mdmetadata.picandmetadata.emailcontacts usePII.ownership_emails. The default remains HIGH. Operators can explicitly set that check toinfousing--policy; the contact stays visible in reports. Add the existing policy-overlay interface totier1andtier1 validate.PII.emails. No organization/domain allowlist is introduced. Invalid/ambiguous metadata retains ordinary email policy; credential checks are unchanged.Example operator policy:
Coordination and scope
Review follow-up
Direct Review Guru review reproduced and fixed three additional cases:
Synchronized with current main and resolved the changelog conflict. Current head:
64894e4.Verification
make teston64894e4, six workers, color-enabled terminal: 21,636 passed, 36 skipped, 444.86 seconds.make lint,make build, new-file formatting, andgit diff --checkpass.fern check: zero errors; the remote FDR redirect comparison remains unavailable (one warning).A remaining upstream limitation was reproduced directly with SkillSpector: quoted version
"1.0.0"inside valid flow-style YAML is treated as a missing file reference. Removing only that version value produces complete analysis. The ownership policy passes independently; this PR correctly preserves the separate incomplete gate and displays its reason. It does not fix that scanner parser behavior or establish a security defect in the skill.The named Bugbot and Security Review passes were not available; the review above is the direct Review Guru implementation/QA pass. The existing OSS-boundary anchor failure was also reproduced on the original unchanged base and is unrelated to this diff.
Release Impact
PII.emailsoverrides do not implicitly apply to the new ownership-specific check.