Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(ci): show concise PR feedback with fresh HTML report links (#326)

Christopher Kevin46a8cf269257
diff --git a/.github/workflows/publish-skill-reports.yml b/.github/workflows/publish-skill-reports.yml
index de990a1b..d8dc90e5 100644
--- a/.github/workflows/publish-skill-reports.yml
+++ b/.github/workflows/publish-skill-reports.yml
@@ -167,13 +167,66 @@ jobs:
ref: gh-pages
path: site
persist-credentials: false
+ - name: Identify the retained site revision
+ id: site
+ # workflow_run events share the default-branch SHA. Pages uses its
+ # build SHA as deployment identity, so use the retained site revision.
+ run: |
+ echo "revision=$(git -C site rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Package the static report site
+ id: pages
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site
- name: Deploy the static report site
id: deployment
- uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ SITE_REVISION: ${{ steps.site.outputs.revision }}
+ PAGES_ARTIFACT_ID: ${{ steps.pages.outputs.artifact_id }}
+ with:
+ script: |
+ const revision = process.env.SITE_REVISION;
+ const artifact = Number(process.env.PAGES_ARTIFACT_ID);
+ if (!/^[0-9a-f]{40}$/.test(revision || '') || !Number.isSafeInteger(artifact) || artifact < 1) {
+ throw new Error('A retained site revision and uploaded Pages artifact are required.');
+ }
+ const {data: deployment} = await github.request('POST /repos/{owner}/{repo}/pages/deployments', {
+ ...context.repo,
+ artifact_id: artifact,
+ pages_build_version: revision,
+ oidc_token: await core.getIDToken(),
+ request: {timeout: 30000}
+ });
+ if (deployment.id !== revision) {
+ throw new Error('GitHub returned an unexpected Pages deployment identity.');
+ }
+ core.info(`Pages build revision: ${revision}`);
+ let completed = false;
+ const deadline = Date.now() + 300000;
+ try {
+ for (let attempt = 0; attempt < 60 && Date.now() < deadline; attempt++) {
+ const {data: status} = await github.request('GET /repos/{owner}/{repo}/pages/deployments/{deployment_id}', {
+ ...context.repo, deployment_id: revision, request: {timeout: 30000}
+ });
+ if (status.status === 'succeed') {
+ completed = true;
+ core.setOutput('page_url', deployment.page_url);
+ return;
+ }
+ if (['deployment_failed', 'deployment_content_failed', 'deployment_cancelled', 'deployment_lost'].includes(status.status)) {
+ throw new Error(`Pages deployment did not complete: ${status.status}`);
+ }
+ await new Promise(resolve => setTimeout(resolve, 5000));
+ }
+ throw new Error('Pages deployment timed out before publication was confirmed.');
+ } finally {
+ if (!completed) {
+ await github.request('POST /repos/{owner}/{repo}/pages/deployments/{deployment_id}/cancel', {
+ ...context.repo, deployment_id: revision, request: {timeout: 30000}
+ }).catch(() => core.warning('Could not cancel the unfinished Pages deployment.'));
+ }
+ }
comment:
needs: [prepare, deploy]
# Comment only after this run's own deploy. A skipped deploy means another
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a2b1cb20..23d2004c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -243,6 +243,11 @@ All notable changes to SkillEvaluator are documented in this file.
### Fixed
+- PR scan comments show the verdict, quality scores, first actionable fixes and
+ report links; full provenance and detailed findings stay in the report.
+- Hosted reports use the retained site commit as the Pages deployment identity,
+ so repeated publications from one default-branch revision deploy fresh reports.
+
- Reusable Tier 1 CI always requires Semgrep in scanner subprocesses, so local
optional-scanner defaults cannot hide missing CI code-scanning coverage.
diff --git a/ci/report_views.py b/ci/report_views.py
index 08f50f44..81f5314a 100644
--- a/ci/report_views.py
+++ b/ci/report_views.py
@@ -508,7 +508,9 @@ def _first_action(model: dict) -> tuple[str, str, str]:
)
-def _compact_summary(models: list[dict], summary: dict, context: dict, *, status: str, llm: str, footer: str) -> str:
+def _compact_summary(
+ models: list[dict], summary: dict, context: dict, *, status: str, llm: str, footer: str, include_scores: bool = False
+) -> str:
"""Keep the Actions landing view small; detailed evidence lives in reports."""
outcomes = [
"INCOMPLETE"
@@ -536,10 +538,20 @@ def _compact_summary(models: list[dict], summary: dict, context: dict, *, status
status = "ERROR"
if status.startswith("INCOMPLETE"):
status = "INCOMPLETE"
- lines = ["# Skill scan", f"**Tier 1 scan result: {_brief(status)}**"]
+ lines = ([] if include_scores else ["# Skill scan"]) + [f"**Tier 1 scan result: {_brief(status)}**"]
+ noun = "skill" if include_scores and len(models) == 1 else "skills"
lines.append(
- f"{len(models)} skills · {counts['PASS']} passed · {counts['FAIL']} failed · {counts['INCOMPLETE']} incomplete"
+ f"{len(models)} {noun} · {counts['PASS']} passed · {counts['FAIL']} failed · {counts['INCOMPLETE']} incomplete"
)
+ if include_scores and models:
+ lines.extend(["| Skill | Status | Quality / 100 |", "| --- | --- | --- |"])
+ for model, outcome in list(zip(models, outcomes, strict=True))[:SUMMARY_SKILL_LIMIT]:
+ quality = model["quality"][0] if len(model["quality"]) == 1 else {}
+ score = _score(quality.get("overall_score"))
+ grade = _brief(quality.get("grade"))
+ lines.append(f"| {_brief(model['row'].get('path'), 240)} | {outcome} | {score} / {grade} |")
+ if len(models) > SUMMARY_SKILL_LIMIT:
+ lines.append(f"{len(models) - SUMMARY_SKILL_LIMIT} more skills are listed in the full report.")
if summary.get("error"):
lines.extend(
[f"**Run error:** {_brief(summary['error'])}", "Correct the workflow configuration and rerun the scan."]
@@ -562,16 +574,24 @@ def _compact_summary(models: list[dict], summary: dict, context: dict, *, status
lines.append(f"**{len(affected) - SUMMARY_SKILL_LIMIT} more affected skills:** open the full report.")
lines.append("Push your fixes to rerun PR checks, or rerun the workflow after resolving scan errors.")
elif models and status in {"PASSED", "PASS"}:
- lines.append("No blocking issues found. Advisory findings remain available in the full report.")
+ lines.append(
+ "No blocking issues found."
+ if include_scores
+ else "No blocking issues found. Advisory findings remain available in the full report."
+ )
elif not summary.get("error"):
lines.append("Inspect the full report and failed workflow step; no complete passing scan is established.")
deleted = _items(_dict(summary.get("selection")).get("deleted"))
if deleted:
lines.append(f"{len(deleted)} completely deleted skill directories were skipped; see summary.json.")
conclusion = context.get("ci_conclusion", context.get("run_conclusion"))
- if conclusion is not None:
+ if conclusion is not None and (not include_scores or conclusion != "success"):
lines.append(f"**CI run conclusion:** {_brief(conclusion, 80)}")
- lines.append(f"Tier 1 only · Tier 2: Not run · Tier 3: Not run. {_brief(llm, 240)}")
+ lines.append(
+ "Tier 1 static checks."
+ if include_scores and context.get("llm_enabled") is False
+ else f"Tier 1 only · Tier 2: Not run · Tier 3: Not run. {_brief(llm, 240)}"
+ )
# The source scan's artifact is also the fallback when reading a separate
# publisher workflow's summary, or when the hosted URL is not deployed yet.
artifact_help = (
@@ -581,7 +601,7 @@ def _compact_summary(models: list[dict], summary: dict, context: dict, *, status
# Preserve the result and counts rather than spending that budget on links.
if len(footer.encode("utf-8")) > SUMMARY_LIMIT // 2 or footer.startswith("Full evidence:"):
footer = artifact_help
- else:
+ elif not include_scores or not context.get("report_url"):
lines.append(artifact_help)
return _bounded(lines, SUMMARY_LIMIT, footer)
@@ -675,7 +695,6 @@ def render_reports(
markdown.append(f"**{label}:** {_md(_text(value)[:4096])}")
if summary.get("error"):
markdown.append(f"**Run error:** {_md(summary['error'])}")
- comment_header = list(markdown)
attention = []
for model in models:
for result, outcome in zip(model["results"], model["statuses"], strict=True):
@@ -705,11 +724,6 @@ def render_reports(
"| --- | --- | --- | --- | --- | --- |",
]
)
- comments = [
- *comment_header,
- "| Skill | Status | Quality / 100 | Errors | Warnings |",
- "| --- | --- | --- | --- | --- |",
- ]
for model in models:
row, data = model["row"], model["data"]
skill = _text(row.get("path"))
@@ -718,7 +732,6 @@ def render_reports(
score, grade = _score(quality.get("overall_score")), _text(quality.get("grade"))
errors, warnings = data.get("total_errors"), data.get("total_warnings")
markdown.append(f"| {_md(skill)} | {skill_status} | {score} | {_md(grade)} | {_md(errors)} | {_md(warnings)} |")
- comments.append(f"| {_md(skill)} | {skill_status} | {score} / {_md(grade)} | {_md(errors)} | {_md(warnings)} |")
details = _Budget(markdown, DETAIL_LIMIT, footer)
for model in models:
row = model["row"]
@@ -728,7 +741,6 @@ def render_reports(
block.append(f"Run error: {_md(row['error'])}")
if model["issue"]:
block.append(_md(model["issue"]))
- comments.append(f"**{_md(skill)}:** {_md(model['issue'])}")
for quality in model["quality"]:
block.extend(
[
@@ -764,22 +776,9 @@ def render_reports(
if details.spent():
break
markdown.append(f"**{_md(label)}:** {_md(value)}")
- failures = [
- result
- for result, outcome in zip(model["results"], model["statuses"], strict=True)
- if outcome in {"FAIL", "INCOMPLETE", "UNKNOWN"}
- ]
- for result in failures:
- message, finding = _issue_for_result(result)
- message = message or "See retained evidence."
- comments.append(f"**{_md(skill)} / {_md(result.get('validator'))}:** {_md(_text(message)[:2000])}")
- if finding:
- location = _text(finding.get("file_path"))
- if finding.get("line_number") is not None:
- location += ":" + _text(finding["line_number"])
- comments.append(
- f"Location: {_md(location[:2000])}. Suggested fix: {_md(_text(finding.get('suggestion'))[:2000])}"
- )
_write(reports / "details.md", _bounded(markdown, DETAIL_LIMIT, footer))
_write(reports / "summary.md", _compact_summary(models, summary, context, status=status, llm=llm, footer=footer))
- _write(reports / "pr-comment.md", _bounded(comments, COMMENT_LIMIT, footer))
+ _write(
+ reports / "pr-comment.md",
+ _compact_summary(models, summary, context, status=status, llm=llm, footer=footer, include_scores=True),
+ )
diff --git a/tests/ci/test_publisher_workflow.py b/tests/ci/test_publisher_workflow.py
index 9aa62bb8..ead8000f 100644
--- a/tests/ci/test_publisher_workflow.py
+++ b/tests/ci/test_publisher_workflow.py
@@ -65,7 +65,37 @@ def test_publisher_uses_verified_node24_action_releases():
uses = {step.get("uses", "") for job in jobs.values() for step in job["steps"]}
assert "actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9" in uses
assert "actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9" in uses
- assert "actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346" in uses
+ assert "actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd" in uses
+
+
+ ("revision", "artifact"),
+ [("", "123"), ("bad", "123"), ("a" * 41, "123"), ("a" * 40, ""), ("a" * 40, "0"), ("a" * 40, "9007199254740993")],
+)
+def test_pages_rejects_invalid_identity_before_requesting_credentials(revision, artifact):
+ node = shutil.which("node")
+ if not node:
+ pytest.skip("Node.js is required to exercise the deployed workflow script")
+ steps = load(".github/workflows/publish-skill-reports.yml")["jobs"]["deploy"]["steps"]
+ deploy = next(step for step in steps if step.get("id") == "deployment")
+ script = deploy["with"]["script"]
+ # Run the actual workflow code without an API or token provider. Invalid
+ # identities must be rejected before either collaborator can be accessed.
+ harness = """
+ const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
+ new AsyncFunction('github', 'context', 'core', process.argv[1])({}, {}, {})
+ .then(() => process.exit(2))
+ .catch(error => { console.log(error.message); });
+ """
+ result = subprocess.run(
+ [node, "-e", harness, script],
+ env={**os.environ, "SITE_REVISION": revision, "PAGES_ARTIFACT_ID": artifact},
+ check=True,
+ capture_output=True,
+ text=True,
+ timeout=10,
+ )
+ assert result.stdout.strip() == "A retained site revision and uploaded Pages artifact are required."
def test_privileged_publisher_installs_the_reviewed_hash_locked_bootstrap():
diff --git a/tests/ci/test_report_views.py b/tests/ci/test_report_views.py
index 75ddd5c8..6ea88611 100644
--- a/tests/ci/test_report_views.py
+++ b/tests/ci/test_report_views.py
@@ -124,6 +124,38 @@ def test_scores_scope_and_json_only_publish(tmp_path):
assert (tmp_path / "summary.json").read_bytes() == original
+def test_pr_comment_shows_result_score_and_report_without_provenance_dump(tmp_path):
+ summary, _ = example(tmp_path)
+ context = {
+ "report_url": "https://example.com/reports/1",
+ "run_url": "https://github.com/o/r/actions/runs/1",
+ "ci_conclusion": "success",
+ "llm_enabled": False,
+ "commit": "a" * 40,
+ "image": "ghcr.io/o/image@sha256:" + "b" * 64,
+ }
+ views.render_reports(tmp_path, summary, context)
+ comment = (tmp_path / "pr-comment.md").read_text()
+ visible = visible_markdown(comment)
+ assert "Tier 1 scan result: PASSED" in visible
+ assert "skills/sample" in visible and "98.2 / A" in visible
+ assert "https://example.com/reports/1/index.html" in comment
+ assert "Evaluation scope" not in visible and "Runtime image" not in visible
+ assert "1 skill · 1 passed" in visible and "Tier 1 static checks." in visible
+ assert "CI run conclusion" not in visible and "--no-llm" not in visible
+ assert context["commit"] not in comment and len(comment.encode()) < 1400
+ details = visible_markdown((tmp_path / "details.md").read_text())
+ assert context["commit"] in details and context["image"] in details.replace("\u200b", "")
+
+
+def test_comment_without_hosting_explains_where_to_open_the_html(tmp_path):
+ summary, _ = example(tmp_path)
+ views.render_reports(tmp_path, summary, {"run_url": "https://github.com/o/r/actions/runs/1"})
+ comment = (tmp_path / "pr-comment.md").read_text()
+ assert "download the scan run's report artifact and open index.html" in comment
+ assert "https://github.com/o/r/actions/runs/1" in comment
+
+
def test_failure_finding_location_and_suggestion_are_visible(tmp_path):
result = {
"validator": "Schema",
@@ -662,7 +694,9 @@ def test_comment_retains_run_error_with_all_optional_header_fields(tmp_path):
views.render_reports(tmp_path, summary, context)
comment = visible_markdown((tmp_path / "pr-comment.md").read_text())
assert summary["error"] in comment
- assert context["commit"] in comment and context["image"] in comment.replace("\u200b", "")
+ details = visible_markdown((tmp_path / "details.md").read_text())
+ assert context["commit"] in details and context["image"] in details.replace("\u200b", "")
+ assert context["commit"] not in comment and context["image"] not in comment
assert "Run error" in comment