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.

feat(ci): onboard shared components and private report sites (#335)

Christopher Kevinf878f99a9cd4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ea0a9661..1d339116 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -381,6 +381,100 @@ jobs:
tests/test_plugin_discovery.py
tests/test_oss_packaging.py
+ ci-onboarding-windows:
+ name: CI onboarding (native Windows)
+ needs: classify-changes
+ if: ${{ !cancelled() && needs.classify-changes.outputs.docs_only != 'true' }}
+ runs-on: windows-latest
+ timeout-minutes: 20
+ env:
+ PYTHONUTF8: "1"
+ steps:
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ persist-credentials: false
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
+ with:
+ python-version: "3.12"
+ - uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
+ with:
+ version: "0.11.27"
+ - name: Install onboarding test dependencies
+ run: uv sync --extra dev --locked --python 3.12
+ - name: Test onboarding and native workflow writes
+ shell: pwsh
+ run: |
+ $onboardingTests = @(Get-ChildItem tests -Filter "test_ci_onboarding*.py" | Sort-Object Name | ForEach-Object { $_.FullName })
+ if ($onboardingTests.Count -eq 0) { throw "No onboarding tests were found." }
+ uv run --no-sync pytest -q @onboardingTests
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+ - name: Build and install the base wheel
+ shell: pwsh
+ run: |
+ uv build --wheel --no-sources --python 3.12
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+ $wheels = @(Get-ChildItem dist -Filter "skillevaluator-*.whl")
+ if ($wheels.Count -ne 1) { throw "Expected exactly one freshly built wheel." }
+ $baseEnvironment = Join-Path $env:RUNNER_TEMP "skillevaluator-onboarding-base-windows"
+ uv venv --python 3.12 $baseEnvironment
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+ $basePython = Join-Path $baseEnvironment "Scripts\python.exe"
+ uv pip install --python $basePython $wheels[0].FullName
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+ - name: Smoke-test the installed Windows CLI with a CRLF checkout
+ shell: pwsh
+ run: |
+ $basePython = Join-Path $env:RUNNER_TEMP "skillevaluator-onboarding-base-windows\Scripts\python.exe"
+ @'
+ import importlib.util
+ import json
+ import subprocess
+ import sys
+ import tempfile
+ from pathlib import Path
+
+ assert sys.platform == "win32"
+ assert importlib.util.find_spec("harbor") is None
+ assert importlib.util.find_spec("pytest") is None
+ command = [str(Path(sys.executable).with_name("skillevaluator.exe"))]
+ assert Path(command[0]).is_file()
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory) / "consumer"
+ root.mkdir()
+ def git(*args, **kwargs):
+ return subprocess.run(["git", "-c", "commit.gpgsign=false", "-C", str(root), *args], check=True, **kwargs)
+ git("init", "-b", "main")
+ git("config", "user.name", "Windows onboarding smoke")
+ git("config", "user.email", "[email protected]")
+ git("config", "core.autocrlf", "true")
+ git("remote", "add", "origin", "https://github.com/example/skills.git")
+ skill = root / "skills" / "smoke-check" / "SKILL.md"
+ skill.parent.mkdir(parents=True)
+ skill.write_bytes(b"---\r\nname: smoke-check\r\ndescription: Smoke check skill\r\n---\r\n# Smoke check\r\n")
+ git("add", "skills")
+ git("commit", "-m", "Add smoke skill")
+ common = command + ["ci", "init", "--repo", str(root), "--no-input"]
+ for feedback in ("--checks-only", "--full"):
+ subprocess.run(common + ["--mode", "preview", feedback], check=True)
+ assert not (root / ".github").exists(), "Preview changed the checkout"
+ subprocess.run(common + ["--mode", "save", "--checks-only"], check=True)
+ git("add", ".github")
+ git("commit", "-m", "Add checks")
+ scan_path = ".github/workflows/skill-checks.yml"
+ # Force a fresh checkout: checkout-index can keep an existing
+ # up-to-date LF file even when core.autocrlf is enabled.
+ (root / scan_path).unlink()
+ git("checkout-index", "--index", "--force", "--", scan_path)
+ assert b"\r\n" in (root / scan_path).read_bytes()
+ receipt = Path(directory) / "onboarding.json"
+ subprocess.run(common + ["--mode", "save", "--full", "--output", str(receipt)], check=True)
+ assert (root / ".github/workflows/publish-skill-reports.yml").is_file()
+ actual_blob = git("hash-object", "--path=" + scan_path, "--stdin", input=(root / scan_path).read_bytes(), capture_output=True).stdout.decode().strip()
+ assert json.loads(receipt.read_text())["scan_blob"] == actual_blob
+ subprocess.run(common + ["--mode", "save", "--full"], check=True)
+ '@ | & $basePython -
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+
native-windows-local-mode:
name: Native Windows local mode fails closed
needs: classify-changes
diff --git a/.github/workflows/publish-skill-reports.yml b/.github/workflows/publish-skill-reports.yml
index a682e764..aa562aca 100644
--- a/.github/workflows/publish-skill-reports.yml
+++ b/.github/workflows/publish-skill-reports.yml
@@ -25,15 +25,19 @@ on:
type: string
required: true
trusted-evaluator-shas:
- description: Approved immutable evaluator workflow revisions, separated by commas or newlines
+ description: Approved immutable evaluator revisions; required unless delegated-evaluator-wrapper is set
type: string
- required: true
+ default: ''
trusted-caller-blobs:
description: Approved Git blobs for the consumer scan workflow, separated by commas or newlines
type: string
required: true
trusted-wrapper-workflows:
- description: Optional approved wrapper workflow paths pinned by full SHA, separated by commas or newlines
+ description: Approved exact wrapper workflow paths at full SHAs or tags, separated by commas or newlines
+ type: string
+ default: ''
+ delegated-evaluator-wrapper:
+ description: Optional approved root wrapper allowed to select pinned evaluator revisions; requires a sole caller job
type: string
default: ''
permissions:
@@ -49,6 +53,7 @@ jobs:
contents: write
actions: read
pull-requests: read
+ pages: read
outputs:
report_url: ${{ steps.publish.outputs.report_url }}
pr_number: ${{ steps.publish.outputs.pr_number }}
@@ -105,6 +110,7 @@ jobs:
TRUSTED_EVALUATOR_SHA: ${{ inputs.trusted-evaluator-shas }}
TRUSTED_CALLER_BLOBS: ${{ inputs.trusted-caller-blobs }}
TRUSTED_WRAPPER_WORKFLOWS: ${{ inputs.trusted-wrapper-workflows }}
+ DELEGATED_EVALUATOR_WRAPPER: ${{ inputs.delegated-evaluator-wrapper }}
EVALUATOR_REPOSITORY: ${{ inputs.tools-repository }}
run: |
export SITE_DIR="$GITHUB_WORKSPACE/site" OUTPUT_DIR="$RUNNER_TEMP/report-feedback"
@@ -189,6 +195,7 @@ jobs:
env:
SITE_REVISION: ${{ steps.site.outputs.revision }}
PAGES_ARTIFACT_ID: ${{ steps.pages.outputs.artifact_id }}
+ PAGES_BASE_URL: ${{ inputs.report-base-url }}
with:
script: |
const revision = process.env.SITE_REVISION;
@@ -196,6 +203,30 @@ jobs:
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.');
}
+ // Visibility can change after onboarding or report preparation.
+ // Check again immediately before requesting deployment credentials.
+ const {data: repository} = await github.request('GET /repos/{owner}/{repo}', {
+ ...context.repo, request: {timeout: 30000}
+ });
+ const expected = process.env.PAGES_BASE_URL || '';
+ let privateOrigin;
+ try {
+ privateOrigin = new URL(expected).hostname.endsWith('.pages.github.io');
+ } catch {
+ throw new Error('The configured report URL is invalid.');
+ }
+ const privateUrl = /^https:\/\/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+pages\.github\.io\/?$/;
+ if (repository?.private !== false || repository?.visibility !== 'public' || privateOrigin) {
+ const {data: pages} = await github.request('GET /repos/{owner}/{repo}/pages', {
+ ...context.repo, request: {timeout: 30000}
+ });
+ if (pages?.public !== false || pages?.build_type !== 'workflow' || pages?.cname ||
+ typeof pages?.html_url !== 'string' || !privateUrl.test(pages.html_url) ||
+ !privateUrl.test(expected) || pages.html_url.trim() !== pages.html_url || expected.trim() !== expected ||
+ pages.html_url.replace(/\/$/, '') !== expected.replace(/\/$/, '')) {
+ throw new Error('Private reports require a verified private Pages site at the configured URL; deployment was stopped.');
+ }
+ }
const {data: deployment} = await github.request('POST /repos/{owner}/{repo}/pages/deployments', {
...context.repo,
artifact_id: artifact,
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c8d6829..cd454422 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -712,6 +712,19 @@ All notable changes to SkillEvaluator are documented in this file.
`PATH` is resolved to its target before the smoke test, and the local-mode
isolation message names that resolved path.
+## 0.7.2 - 2026-11-03
+
+- Add reporting to an existing single-job GitHub scan caller while preserving
+ its skill folders, thresholds, triggers and shared component. Explicit wrapper
+ delegation supports central version-tag updates and retains signed scan
+ identity and the resolved workflow commits in published receipts.
+- Support CLI setup with verified private GitHub Pages in eligible Enterprise
+ Cloud organization repositories. Publication rechecks site access and the
+ expected URL before retaining reports and before deployment. Private Pages
+ must already be configured by an administrator.
+- Publish updated onboarding templates and CLI metadata while retaining the
+ existing verified scanner workflow and immutable container image.
+
## 0.6.0 - 2026-10-20
### Added
diff --git a/CITATION.cff b/CITATION.cff
index bcc739a8..a52bb18f 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -2,7 +2,7 @@ cff-version: 1.2.0
message: "If you use SkillEvaluator in academic or technical work, please cite the methodology paper under preferred-citation and record the SkillEvaluator version used for reproducibility."
title: "SkillEvaluator"
type: software
-version: "0.7.1"
+version: "0.7.2"
authors:
- name: "NVIDIA Corporation"
license: Apache-2.0
diff --git a/README.md b/README.md
index 5eb01d0e..0ff2f614 100644
--- a/README.md
+++ b/README.md
@@ -34,13 +34,13 @@ Choose checks and optional hosted feedback, then review the setup PR.
[CLI setup guide](docs/cli-onboarding.mdx).
**Manual setup:** copy a filled-in template from
-[CI templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.1). No local CLI needed.
+[CI templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.2). No local CLI needed.
| Your repository | Ready-to-use template | Copy destination |
| --- | --- | --- |
-| GitHub | [Skill checks](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
-| GitLab | [Skill checks](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing pipeline |
-| GitHub reports and PR comments | [Optional publisher](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/publish-skill-reports.yml) | Second workflow; complete publisher setup |
+| GitHub | [Skill checks](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
+| GitLab | [Skill checks](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing pipeline |
+| GitHub reports and PR comments | [Optional publisher](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/publish-skill-reports.yml) | Second workflow; complete publisher setup |
See [GitHub](docs/github-actions.mdx) and [GitLab](docs/gitlab-ci.mdx) setup,
[template reference](ci/templates/README.md) and [report examples](ci/examples/README.md).
diff --git a/ci/README.md b/ci/README.md
index f7a48a54..ecaa7cda 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -187,11 +187,40 @@ with:
Replace `FULL_COMMIT_SHA` with the reviewed 40-character commit. Multiple wrappers
can be separated by newlines or commas. Each referenced wrapper must be approved;
-branch and tag references are rejected. Continue approving the actual evaluator
+branch references are rejected. Continue approving the actual evaluator
in `trusted-evaluator-shas` and the consumer scan file in `trusted-caller-blobs`.
Review any wrapper update and refresh its pin in both the calling workflow and
publisher approval list; refresh the consumer blob after editing its scan file.
+For a central component maintained at a version tag such as `@v3`, the consumer
+can explicitly delegate evaluator version selection to that component:
+
+```yaml
+with:
+ trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ delegated-evaluator-wrapper: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ trusted-caller-blobs: YOUR_REVIEWED_SCAN_FILE_BLOB
+```
+
+This mode supports one consumer scan job calling one shared component, which
+calls one SHA-pinned evaluator in the configured evaluator repository. Omit
+`trusted-evaluator-shas` when delegating. The publisher verifies GitHub's
+historical tag resolution and the signed evaluator receipt; it never resolves
+today's tag to validate an earlier run. Each report records the resolved wrapper
+commit. Component maintainers can update evaluator pins behind the approved tag
+without changing each consumer; edits to the consumer scan file still need a
+new approved blob. Tag delegation grants that component control over evaluator
+versions and common policy, so enable it only for a component your team trusts.
+Multiple wrapper levels and matrix callers require the explicit SHA allowlists.
+
+`skillevaluator ci init` detects this existing caller, keeps its configuration,
+and prepares the publisher and caller approval automatically. The CLI checks
+the shared component's identity permission before changing GitHub settings.
+For private reports, an administrator first selects **Private** and **GitHub
+Actions** in Pages settings. The CLI verifies the assigned private URL and
+configures report history and the setup PR. It never creates a public site for
+a private repository. Private Pages requires an Enterprise Cloud organization.
+
The consumer scan job **and every wrapper job calling the next workflow** need:
```yaml
diff --git a/ci/bundles/0.7.2/README.md b/ci/bundles/0.7.2/README.md
new file mode 100644
index 00000000..28037da6
--- /dev/null
+++ b/ci/bundles/0.7.2/README.md
@@ -0,0 +1,26 @@
+# Repository CI onboarding
+
+## GitHub: choose your templates
+
+- Checks and downloadable reports: copy `skill-checks.yml` to `.github/workflows/skill-checks.yml`. Set `paths` to your skill roots and choose `min-score` (default 70).
+- Hosted reports and PR comments: also copy `publish-skill-reports.yml` to `.github/workflows/` and complete the one-time setup below.
+
+The workflow and image pins are already filled in. Both templates use GitHub's automatic token; no personal token or model key is needed for the default checks. Your organization must allow the referenced actions and the provided permissions.
+
+### One-time publisher setup
+
+1. Enable Settings → Pages → Source: GitHub Actions. Reports can include source excerpts; a private repository does not automatically make its Pages site private. Use scan artifacts if hosting is unsuitable. Coordinate any existing Pages site first.
+2. Initialize a new `gh-pages` history branch with `.nojekyll` and `history.json` containing `[]`. Preserve existing site content and history.
+3. Set `YOUR_REPORT_BASE_URL` in the publisher template to your Pages URL.
+4. Uncomment `id-token: write` under `permissions` in `skill-checks.yml` for signed execution receipts. After customizing the scan file, run `git hash-object .github/workflows/skill-checks.yml` and put the result in `trusted-caller-blobs`. Refresh this value after every scan-file edit.
+5. Merge both files into your default branch, keeping the supplied scan filename, workflow name and artifact name. The publisher already declares its required permissions.
+
+New eligible PR scans trigger publication automatically. After successful deployment, the bot creates or updates one comment on the current, open, same-repository PR. Fork PR comments and comment-only operation are not supported by this publisher.
+
+Without the signing permission, ordinary scans and downloadable reports still run; hosting is skipped. Commit the setup and trigger a new scan; rerunning an old job keeps its original workflow.
+
+[Full publisher setup](https://github.com/NVIDIA/SkillEvaluator/blob/8096c6966a498f35f6f7dc1a596d1cc4da85cf11/ci/README.md#optional-hosted-reports-and-pr-feedback).
+
+## GitLab
+
+For GitLab, merge gitlab-skill-checks.yml into your root .gitlab-ci.yml and set SKILL_EVAL_PATHS. Its rules must remain in the root file to enable merge-request pipelines.
diff --git a/ci/bundles/0.7.2/SHA256SUMS.txt b/ci/bundles/0.7.2/SHA256SUMS.txt
new file mode 100644
index 00000000..7349df80
--- /dev/null
+++ b/ci/bundles/0.7.2/SHA256SUMS.txt
@@ -0,0 +1,9 @@
+67eb3a382a3b09794f0e9b436348646a3872ef87367f92cc2ccf24dc9e0b1659 README.md
+58efa999e85bff0334f928b5fba637c1c3b03c46103e449177862c15565971b1 gitlab-skill-checks.yml
+09a60099245907017198585fc820e8b5af05eaf65426e1596535c07dee2d54c0 publish-skill-reports.yml
+3a36176760fc44c883c9d24498140ea9b7a8f18da37422b398bf34d94d810ed6 release.json
+21f4dd9936ab4da840adc102eed9f43bad8ffb88ff5c59d2ccfdc846baa8666f scanner-inventory.json
+235e992b2a549a2cccbd6e07e853e85a85bee91a68b763d1129c09325141b26b skill-checks-llm.yml
+ccc3fb2da16b68ff0fcf91792046f22417fe621ad6215532398935ff869019d2 skill-checks.yml
+c277a0242bdfbb03ce83694c0b5ab8cfd2f2ecc38159bc358a7afcbf3999213d skillevaluator-ci-0.7.2.zip
+5cec9d23a5eb403056e2cea0966646027f0ab7ebba3d7c68d792df9739c0abd5 verification-receipt.json
diff --git a/ci/bundles/0.7.2/gitlab-skill-checks.yml b/ci/bundles/0.7.2/gitlab-skill-checks.yml
new file mode 100644
index 00000000..08612041
--- /dev/null
+++ b/ci/bundles/0.7.2/gitlab-skill-checks.yml
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: Apache-2.0
+# Merge this into an existing .gitlab-ci.yml or use it as the complete file.
+# The release-generated copy pins both the reusable job and its container image.
+include:
+ - remote: https://raw.githubusercontent.com/NVIDIA/SkillEvaluator/46a8cf269257d1ec56a0285c508ac9ee48010930/ci/gitlab/skill-evaluation.yml
+
+variables:
+ SKILL_EVAL_IMAGE: ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4
+ SKILL_EVAL_PATHS: "skills"
+ SKILL_EVAL_MIN_SCORE: "70"
+
+# GitLab requires merge-request rules directly in the root file, even when a
+# job is included. Preserve your existing workflow rules if you have them.
+skill-evaluation:
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+ - if: '$CI_PIPELINE_SOURCE == "web"'
diff --git a/ci/bundles/0.7.2/publish-skill-reports.yml b/ci/bundles/0.7.2/publish-skill-reports.yml
new file mode 100644
index 00000000..a389a7f7
--- /dev/null
+++ b/ci/bundles/0.7.2/publish-skill-reports.yml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: Apache-2.0
+# Optional: requires Pages, a retained gh-pages branch and your own trust settings.
+# Pages reports are public unless the site is explicitly private (GitHub Enterprise Cloud).
+# Reports include source evidence; private repositories should otherwise use scan artifacts.
+# Use the release-generated file; set your own URL and refresh the caller blob after scan-file edits.
+# Also grant id-token: write in skill-checks.yml so scans retain signed execution receipts.
+name: Publish skill reports
+on:
+ workflow_run:
+ workflows: [Skill checks]
+ types: [completed]
+ workflow_dispatch:
+ inputs:
+ run-id:
+ description: Completed Skill checks run to publish
+ type: string
+ required: true
+ run-attempt:
+ description: Completed attempt number for that run
+ type: string
+ required: true
+permissions:
+ contents: write
+ actions: read
+ pages: write
+ id-token: write
+ pull-requests: write
+jobs:
+ reports:
+ uses: NVIDIA/SkillEvaluator/.github/workflows/publish-skill-reports.yml@8096c6966a498f35f6f7dc1a596d1cc4da85cf11
+ with:
+ run-id: ${{ format('{0}', github.event.workflow_run.id || inputs.run-id) }}
+ run-attempt: ${{ format('{0}', github.event.workflow_run.run_attempt || inputs.run-attempt) }}
+ report-base-url: YOUR_REPORT_BASE_URL
+ trusted-evaluator-shas: 46a8cf269257d1ec56a0285c508ac9ee48010930
+ trusted-caller-blobs: aace01ee7e9049b9f680534ac4fa5b76c1dde426
+ # Approve each wrapper by its exact workflow path and full SHA or tag name.
+ # Tags use GitHub's recorded historical commit, never the tag's current target.
+ # trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@FULL_COMMIT_SHA
+ # To let one shared wrapper select new pinned evaluator revisions, explicitly delegate:
+ # trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ # delegated-evaluator-wrapper: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ # Delegation requires the approved caller's only job to call that wrapper, without a matrix.
+ # Only this wrapper and one pinned evaluator leaf may appear in the historical run.
+ # With delegation, trusted-evaluator-shas may be omitted; caller blob approval stays required.
+ tools-ref: 8096c6966a498f35f6f7dc1a596d1cc4da85cf11
+ tools-repository: NVIDIA/SkillEvaluator
diff --git a/ci/bundles/0.7.2/release.json b/ci/bundles/0.7.2/release.json
new file mode 100644
index 00000000..f7f3e63c
--- /dev/null
+++ b/ci/bundles/0.7.2/release.json
@@ -0,0 +1,7 @@
+{
+ "repository": "NVIDIA/SkillEvaluator",
+ "workflow_ref": "46a8cf269257d1ec56a0285c508ac9ee48010930",
+ "publisher_ref": "8096c6966a498f35f6f7dc1a596d1cc4da85cf11",
+ "image": "ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4",
+ "caller_blob": "aace01ee7e9049b9f680534ac4fa5b76c1dde426"
+}
diff --git a/ci/bundles/0.7.2/scanner-inventory.json b/ci/bundles/0.7.2/scanner-inventory.json
new file mode 100644
index 00000000..8a190012
--- /dev/null
+++ b/ci/bundles/0.7.2/scanner-inventory.json
@@ -0,0 +1,32 @@
+{
+ "bandit": {
+ "command": "bandit --version",
+ "version": "1.9.4"
+ },
+ "pip-audit": {
+ "command": "pip-audit --version",
+ "version": "2.10.1"
+ },
+ "skillspector": {
+ "command": "skillspector --version",
+ "version": "2.13.3"
+ },
+ "skillevaluator": {
+ "command": "skillevaluator --version",
+ "version": "0.7.0"
+ },
+ "semgrep": {
+ "command": "semgrep --version",
+ "version": "1.182.0"
+ },
+ "gitleaks": {
+ "command": "gitleaks version",
+ "version": "8.30.0"
+ },
+ "verification": {
+ "method": "Version commands executed in the runtime stage of the official image build; anonymous public manifest configuration digest matches the actual image used by all five release smoke cases.",
+ "image": "ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4",
+ "source_revision": "46a8cf269257d1ec56a0285c508ac9ee48010930",
+ "build_run": "https://github.com/NVIDIA/SkillEvaluator/actions/runs/41571133750"
+ }
+}
diff --git a/ci/bundles/0.7.2/skill-checks-llm.yml b/ci/bundles/0.7.2/skill-checks-llm.yml
new file mode 100644
index 00000000..8074da85
--- /dev/null
+++ b/ci/bundles/0.7.2/skill-checks-llm.yml
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: Apache-2.0
+# Optional trusted manual run; the basic skill-checks.yml needs no model secret.
+# Use the release-generated copy with reviewed workflow and image pins.
+name: Skill checks with LLM
+on:
+ workflow_dispatch:
+permissions:
+ contents: read
+jobs:
+ skills:
+ uses: NVIDIA/SkillEvaluator/.github/workflows/evaluate-skills.yml@46a8cf269257d1ec56a0285c508ac9ee48010930
+ with:
+ image: ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4
+ paths: skills
+ min-score: 70
+ scan-mode: all
+ llm: true
+ llm-provider: openai
+ secrets:
+ LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
diff --git a/ci/bundles/0.7.2/skill-checks.yml b/ci/bundles/0.7.2/skill-checks.yml
new file mode 100644
index 00000000..aace01ee
--- /dev/null
+++ b/ci/bundles/0.7.2/skill-checks.yml
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: Apache-2.0
+# Use the release-generated copy with reviewed workflow and image pins.
+name: Skill checks
+on:
+ pull_request:
+ push:
+ branches: [main]
+ workflow_dispatch:
+permissions:
+ contents: read
+ # Hosted reports/PR comments: uncomment this, then refresh trusted-caller-blobs.
+ # id-token: write
+jobs:
+ skills:
+ uses: NVIDIA/SkillEvaluator/.github/workflows/evaluate-skills.yml@46a8cf269257d1ec56a0285c508ac9ee48010930
+ with:
+ image: ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4
+ paths: skills
+ min-score: 70
+ scan-mode: auto
+ llm: false
diff --git a/ci/bundles/0.7.2/skillevaluator-ci-0.7.2.zip b/ci/bundles/0.7.2/skillevaluator-ci-0.7.2.zip
new file mode 100644
index 00000000..44c695cf
Binary files /dev/null and b/ci/bundles/0.7.2/skillevaluator-ci-0.7.2.zip differ
diff --git a/ci/bundles/0.7.2/verification-receipt.json b/ci/bundles/0.7.2/verification-receipt.json
new file mode 100644
index 00000000..41391905
--- /dev/null
+++ b/ci/bundles/0.7.2/verification-receipt.json
@@ -0,0 +1,86 @@
+{
+ "all_verified": true,
+ "image": "ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4",
+ "source_revision": "46a8cf269257d1ec56a0285c508ac9ee48010930",
+ "platform": {
+ "os": "linux",
+ "architecture": "amd64"
+ },
+ "public_manifest_matches_smoke_tested_image": true,
+ "anonymous_pull_verified": true,
+ "official_build_run": "https://github.com/NVIDIA/SkillEvaluator/actions/runs/41571133750",
+ "image_config_digest": "sha256:5101f8c67674ecbd680e8c692ff6a66d3912b902d1f0b2b76c5243f9c9f83847",
+ "image_smoke_cases": [
+ {
+ "case": "all-pass",
+ "verified": true,
+ "exit_code": 0,
+ "overall_status": "passed",
+ "total": 2,
+ "passed": 2,
+ "failed": 0,
+ "incomplete": 0,
+ "summary_bytes": 405,
+ "summary_json_sha256": "2d2fe50362cd897bd9178c4c7313f3f5a49999646eb50e8cd6bf84562b369b33",
+ "base_sha": "567574ee5e9d2ad5657a42a69be4bab777938441",
+ "head_sha": "567574ee5e9d2ad5657a42a69be4bab777938441"
+ },
+ {
+ "case": "invalid-name",
+ "verified": true,
+ "exit_code": 1,
+ "overall_status": "failed",
+ "total": 2,
+ "passed": 1,
+ "failed": 1,
+ "incomplete": 0,
+ "summary_bytes": 718,
+ "summary_json_sha256": "b837b3d94ddf75d416db35da0314aaa2e6dd6c7f0581a4815059868083eb452a",
+ "base_sha": "567574ee5e9d2ad5657a42a69be4bab777938441",
+ "head_sha": "caced15fbfe9a942c3db9323033ff53b8aff13dc"
+ },
+ {
+ "case": "changed-one",
+ "verified": true,
+ "exit_code": 0,
+ "overall_status": "passed",
+ "total": 1,
+ "passed": 1,
+ "failed": 0,
+ "incomplete": 0,
+ "summary_bytes": 405,
+ "summary_json_sha256": "a79d8a4dad864c235a3d63704e3626f86d08c32078dd83dd05b7e589e353a566",
+ "base_sha": "567574ee5e9d2ad5657a42a69be4bab777938441",
+ "head_sha": "72e27cbc374fce9fc18ac64aab40d48613365e74"
+ },
+ {
+ "case": "no-change",
+ "verified": true,
+ "exit_code": 0,
+ "overall_status": "skipped",
+ "total": 0,
+ "passed": 0,
+ "failed": 0,
+ "incomplete": 0,
+ "summary_bytes": 365,
+ "summary_json_sha256": "eaf07d83cfd9d5a244d9c1d22aacf635d5fa89c433b337910edc87fdda6fefc9",
+ "base_sha": "567574ee5e9d2ad5657a42a69be4bab777938441",
+ "head_sha": "98d6267818eeab113d0f0890f3c1de7e7889f11c"
+ },
+ {
+ "case": "missing-llm-key",
+ "verified": true,
+ "exit_code": 1,
+ "overall_status": "error",
+ "total": 0,
+ "passed": 0,
+ "failed": 0,
+ "incomplete": 0,
+ "summary_bytes": 464,
+ "summary_json_sha256": "9f89109579141d1cd1dd80661e1b6ff82a6762bfcb2450becd7aaf4aa3c7d0ef",
+ "base_sha": "567574ee5e9d2ad5657a42a69be4bab777938441",
+ "head_sha": "567574ee5e9d2ad5657a42a69be4bab777938441"
+ }
+ ],
+ "scope": "Fresh official image build, five real container smoke cases, anonymous pull, and public registry identity. Consumer GitHub/GitLab runs are recorded separately."
+}
diff --git a/ci/bundles/README.md b/ci/bundles/README.md
index 23cf3ac3..4da5c7e2 100644
--- a/ci/bundles/README.md
+++ b/ci/bundles/README.md
@@ -6,20 +6,20 @@ needed for manual setup.
| Result | Current configuration | Copy destination |
| --- | --- | --- |
-| GitHub checks | [skill-checks.yml](0.7.1/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
-| GitHub hosted reports and PR comments | [publish-skill-reports.yml](0.7.1/publish-skill-reports.yml) | Second workflow; follow the [setup instructions](0.7.1/README.md) |
-| GitLab checks | [gitlab-skill-checks.yml](0.7.1/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing pipeline |
-| Optional manual LLM checks | [skill-checks-llm.yml](0.7.1/skill-checks-llm.yml) | `.github/workflows/skill-checks-llm.yml` |
+| GitHub checks | [skill-checks.yml](0.7.2/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
+| GitHub hosted reports and PR comments | [publish-skill-reports.yml](0.7.2/publish-skill-reports.yml) | Second workflow; follow the [setup instructions](0.7.2/README.md) |
+| GitLab checks | [gitlab-skill-checks.yml](0.7.2/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing pipeline |
+| Optional manual LLM checks | [skill-checks-llm.yml](0.7.2/skill-checks-llm.yml) | `.github/workflows/skill-checks-llm.yml` |
Open a file and use GitHub's **Raw** view to copy its full contents. Workflow
-commits and the container image digest are already pinned. [Full setup](0.7.1/README.md).
+commits and the container image digest are already pinned. [Full setup](0.7.2/README.md).
## Download and verification
-[Download the current ZIP](0.7.1/skillevaluator-ci-0.7.1.zip). Each version folder
+[Download the current ZIP](0.7.2/skillevaluator-ci-0.7.2.zip). Each version folder
contains the exact generated files, checksums, source/image identities and
-scanner verification records. The historical [0.7.0 files](0.7.0/) remain
-available for existing configurations; use 0.7.1 for current onboarding.
+scanner verification records. The historical [0.7.0 files](0.7.0/) and [0.7.1 files](0.7.1/) remain
+available for existing configurations; use 0.7.2 for current onboarding.
## Release convention
diff --git a/ci/publish_reports.py b/ci/publish_reports.py
index 86431409..0343ce74 100644
--- a/ci/publish_reports.py
+++ b/ci/publish_reports.py
@@ -6,12 +6,16 @@
Run only from a trusted revision in a privileged workflow. This helper writes
static files; the workflow owns Git commits, Pages deployment and PR comments.
-TRUSTED_EVALUATOR_SHA and TRUSTED_CALLER_BLOBS must explicitly allow the reusable
-workflow commit and exact caller workflow blob; neither has a permissive default.
+TRUSTED_CALLER_BLOBS always approves the exact caller workflow. Evaluator commits
+require TRUSTED_EVALUATOR_SHA unless DELEGATED_EVALUATOR_WRAPPER explicitly
+delegates revision selection to a single approved wrapper.
"""
from __future__ import annotations
+import base64
+import binascii
+import hashlib
import html
import io
import json
@@ -476,15 +480,17 @@ def _validate_run(run: dict, repository: str, run_id: int):
raise PublicationError("The selected run lacks valid revision and attempt metadata.")
-def _trusted_pins(variable: str) -> set[str]:
+def _trusted_pins(variable: str, *, optional=False) -> set[str]:
raw = os.environ.get(variable, "")
+ if optional and not raw.strip():
+ return set()
values = re.split(r"[,\n]", raw.strip())
if not raw or len(values) > 32 or any(SHA_PATTERN.fullmatch(value.strip()) is None for value in values):
raise PublicationError("Trusted revision allowlists require comma- or newline-separated full commit/blob SHAs.")
return {value.strip() for value in values}
-def _caller_blob(api, repository: str, sha: str) -> str:
+def _caller_blob(api, repository: str, sha: str, *, delegate="") -> str:
caller = api.get(f"/repos/{repository}/contents/{WORKFLOW_PATH}?ref={sha}")
if (
not isinstance(caller, dict)
@@ -494,24 +500,98 @@ def _caller_blob(api, repository: str, sha: str) -> str:
or SHA_PATTERN.fullmatch(caller["sha"]) is None
):
raise PublicationError("The caller workflow lacks a valid Git blob identity.")
+ if delegate:
+ _validate_delegated_caller(caller, delegate)
return caller["sha"]
+def _validate_delegated_caller(caller: dict, delegate: str) -> None:
+ """Prove the only root workflow job calls the explicitly trusted delegate.
+
+ The run API lists referenced workflows without parent/child edges. Requiring
+ this root plus exactly two references proves the leaf is downstream without
+ needing a token that can read the private wrapper repository.
+ """
+ import yaml
+
+ content = caller.get("content")
+ if caller.get("encoding") != "base64" or not isinstance(content, str) or len(content) > 350_000:
+ raise PublicationError("Delegation requires the historical caller workflow contents.")
+ try:
+ raw = base64.b64decode("".join(content.split()), validate=True)
+ if len(raw) > 256 * 1024:
+ raise ValueError
+ blob = hashlib.sha1(b"blob " + str(len(raw)).encode("ascii") + b"\0" + raw).hexdigest()
+ if blob != caller["sha"]:
+ raise ValueError
+ source = raw.decode("utf-8")
+ # Reject YAML aliases and ambiguous mappings instead of allowing parser
+ # differences to change which job the approved caller invokes.
+ for count, token in enumerate(yaml.scan(source)):
+ if count > 20_000 or isinstance(
+ token, (yaml.tokens.AliasToken, yaml.tokens.AnchorToken, yaml.tokens.TagToken)
+ ):
+ raise ValueError
+
+ class UniqueLoader(yaml.BaseLoader):
+ def construct_mapping(self, node, deep=False):
+ mapping = {}
+ for key_node, value_node in node.value:
+ key = self.construct_object(key_node, deep=deep)
+ if not isinstance(key, str) or key in mapping or key == "<<":
+ raise ValueError
+ mapping[key] = self.construct_object(value_node, deep=deep)
+ return mapping
+
+ document = yaml.load(source, Loader=UniqueLoader)
+ except (ValueError, UnicodeError, binascii.Error, yaml.YAMLError, RecursionError) as exc:
+ raise PublicationError("The delegated caller contents are invalid or ambiguous.") from exc
+ jobs = document.get("jobs") if isinstance(document, dict) else None
+ if not isinstance(jobs, dict) or len(jobs) != 1:
+ raise PublicationError("Delegation requires exactly one caller job invoking the approved wrapper.")
+ job = next(iter(jobs.values()))
+ if (
+ not isinstance(job, dict)
+ or job.get("uses") != delegate
+ or any(key in job for key in ("steps", "runs-on", "strategy"))
+ ):
+ raise PublicationError("Delegation requires exactly one caller job invoking the approved wrapper.")
+
+
+def _workflow_reference(value: str) -> tuple[str, str]:
+ pattern = r"([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/\.github/workflows/[A-Za-z0-9_-][A-Za-z0-9_.-]*\.ya?ml)@([A-Za-z0-9_-][A-Za-z0-9_./-]*)"
+ match = re.fullmatch(pattern, value)
+ if match is None:
+ raise PublicationError("Approved wrappers require an exact workflow path and full SHA or tag name.")
+ workflow, ref = match.groups()
+ if (
+ len(ref) > 255
+ or ".." in ref
+ or any(not part or part.startswith(".") or part.endswith((".lock", ".")) for part in ref.split("/"))
+ ):
+ raise PublicationError("The approved wrapper tag name is invalid.")
+ return workflow, ref
+
+
def _trusted_wrappers() -> set[str]:
raw = os.environ.get("TRUSTED_WRAPPER_WORKFLOWS", "").strip()
if not raw:
return set()
values = [value.strip() for value in re.split(r"[,\n]", raw)]
- pattern = r"[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/\.github/workflows/[A-Za-z0-9_-][A-Za-z0-9_.-]*\.ya?ml@[0-9a-f]{40}"
- if len(raw) > 32768 or len(values) > 32 or any(re.fullmatch(pattern, value) is None for value in values):
- raise PublicationError("Approved wrappers require owner/repository/.github/workflows/file.yml@<full SHA> pins.")
+ if len(raw) > 32768 or len(values) > 32:
+ raise PublicationError("The approved wrapper allowlist exceeds its limit.")
+ for value in values:
+ _workflow_reference(value)
return set(values)
def _validate_workflow_provenance(api, repository: str, run: dict) -> dict:
- evaluator_pins = _trusted_pins("TRUSTED_EVALUATOR_SHA")
caller_blobs = _trusted_pins("TRUSTED_CALLER_BLOBS")
approved_wrappers = _trusted_wrappers()
+ delegate = os.environ.get("DELEGATED_EVALUATOR_WRAPPER", "").strip()
+ if delegate and delegate not in approved_wrappers:
+ raise PublicationError("Evaluator delegation requires one explicitly approved wrapper workflow.")
+ evaluator_pins = _trusted_pins("TRUSTED_EVALUATOR_SHA", optional=bool(delegate))
references = run.get("referenced_workflows")
if not isinstance(references, list) or not 1 <= len(references) <= 33:
raise PublicationError("The scan must reference one approved evaluator and only explicitly approved wrappers.")
@@ -522,29 +602,34 @@ def _validate_workflow_provenance(api, repository: str, run: dict) -> dict:
evaluator_sha = None
seen = set()
wrappers = set()
+ resolved_wrappers = []
for reference in references:
if not isinstance(reference, dict):
raise PublicationError("The scan has an invalid workflow reference.")
path, sha = reference.get("path"), reference.get("sha")
- if (
- not isinstance(path, str)
- or not isinstance(sha, str)
- or SHA_PATTERN.fullmatch(sha) is None
- or not path.endswith(f"@{sha}")
- or path in seen
- ):
- raise PublicationError("The scan has a duplicate or non-immutable workflow reference.")
+ if not isinstance(path, str) or not isinstance(sha, str) or SHA_PATTERN.fullmatch(sha) is None or path in seen:
+ raise PublicationError("The scan has a duplicate or invalid workflow reference.")
seen.add(path)
- if path == f"{workflow}@{sha}" and sha in evaluator_pins:
+ if path == f"{workflow}@{sha}" and (sha in evaluator_pins or delegate):
if evaluator_sha is not None:
raise PublicationError("The scan must reference exactly one approved evaluator.")
evaluator_sha = sha
elif path in approved_wrappers and not path.startswith(f"{workflow}@"):
+ _, ref = _workflow_reference(path)
+ if SHA_PATTERN.fullmatch(ref):
+ if ref != sha:
+ raise PublicationError("The wrapper revision does not match its immutable pin.")
+ elif reference.get("ref") != f"refs/tags/{ref}":
+ raise PublicationError("The wrapper tag lacks a matching historical GitHub tag identity.")
+ else:
+ resolved_wrappers.append({"path": path, "ref": reference["ref"], "sha": sha})
wrappers.add(path)
else:
raise PublicationError("The scan references an unapproved evaluator or wrapper workflow.")
if evaluator_sha is None:
raise PublicationError("The selected run did not use an approved immutable evaluator workflow.")
+ if delegate and (len(references) != 2 or wrappers != {delegate}):
+ raise PublicationError("Delegation requires exactly the approved root wrapper and one evaluator leaf.")
# The receipt is a separate artifact made by the trusted reusable workflow.
# PR associations and current merge refs are mutable, so they never identify
# which caller configuration produced a historical report.
@@ -561,9 +646,14 @@ def _validate_workflow_provenance(api, repository: str, run: dict) -> dict:
)
except ProvenanceError as exc:
raise PublicationError(str(exc)) from exc
- if _caller_blob(api, repository, identity["workflow_sha"]) not in caller_blobs:
+ if _caller_blob(api, repository, identity["workflow_sha"], delegate=delegate) not in caller_blobs:
raise PublicationError("The caller workflow differs from the approved workflow blobs.")
- return {"evaluator_sha": evaluator_sha, "wrapper_workflows": sorted(wrappers)}
+ return {
+ "evaluator_sha": evaluator_sha,
+ "wrapper_workflows": sorted(wrappers),
+ "resolved_wrapper_workflows": sorted(resolved_wrappers, key=lambda item: item["path"]),
+ "delegated_evaluator_wrapper": delegate,
+ }
def _timestamp(value: str) -> datetime:
@@ -788,6 +878,35 @@ def _recorded_image(summary: dict, fallback: str) -> str:
return selected
+def _validate_pages_privacy(api, repository: str, base_url: str) -> None:
+ """Recheck access control immediately before retaining source-bearing reports."""
+ info = api.get(f"/repos/{repository}")
+ private_origin = (urllib.parse.urlsplit(base_url).hostname or "").endswith(".pages.github.io")
+ if (
+ isinstance(info, dict)
+ and info.get("private") is False
+ and info.get("visibility") == "public"
+ and not private_origin
+ ):
+ return
+ pages = api.get(f"/repos/{repository}/pages")
+ actual = pages.get("html_url") if isinstance(pages, dict) else None
+ private_url = r"https://(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+pages\.github\.io/?"
+ if (
+ not isinstance(pages, dict)
+ or pages.get("public") is not False
+ or pages.get("build_type") != "workflow"
+ or pages.get("cname")
+ or not isinstance(actual, str)
+ or re.fullmatch(private_url, actual) is None
+ or re.fullmatch(private_url, base_url) is None
+ or actual.removesuffix("/") != base_url.removesuffix("/")
+ ):
+ raise PublicationError(
+ "Private reports require a verified private Pages site at the configured URL; publication was stopped."
+ )
+
+
def publish(
api,
repository: str,
@@ -852,12 +971,17 @@ def publish(
}
if provenance["wrapper_workflows"]:
receipt["trusted_wrapper_workflows"] = provenance["wrapper_workflows"]
+ if provenance["resolved_wrapper_workflows"]:
+ receipt["resolved_wrapper_workflows"] = provenance["resolved_wrapper_workflows"]
+ if provenance["delegated_evaluator_wrapper"]:
+ receipt["delegated_evaluator_wrapper"] = provenance["delegated_evaluator_wrapper"]
if selected_image:
receipt["image"] = selected_image
destination = site / relative
existing = _read_retained(destination / "receipt.json", None)
if existing is not None and existing != receipt:
raise PublicationError("An immutable run path already contains different publication evidence.")
+ _validate_pages_privacy(api, repository, base_url)
if existing is None:
if destination.exists():
raise PublicationError("An immutable run path already exists without its receipt.")
diff --git a/ci/templates/README.md b/ci/templates/README.md
index 9b8b191b..d55914bd 100644
--- a/ci/templates/README.md
+++ b/ci/templates/README.md
@@ -19,7 +19,7 @@ a separate demo repository.
## Get a version you can run
**These source templates contain placeholders.** Copy the
-[ready-to-use configurations](../bundles/0.7.1/README.md) instead; their reviewed
+[ready-to-use configurations](../bundles/0.7.2/README.md) instead; their reviewed
workflow commits and container image digest are already filled in.
Open a file in that folder and use GitHub's **Raw** view to copy its complete
diff --git a/ci/templates/publish-skill-reports.yml b/ci/templates/publish-skill-reports.yml
index dee8015e..f4c16737 100644
--- a/ci/templates/publish-skill-reports.yml
+++ b/ci/templates/publish-skill-reports.yml
@@ -34,7 +34,14 @@ jobs:
report-base-url: YOUR_REPORT_BASE_URL
trusted-evaluator-shas: RELEASE_WORKFLOW_SHA
trusted-caller-blobs: YOUR_APPROVED_CALLER_BLOB
- # When the scan calls through shared wrappers, approve each full workflow path@SHA.
+ # Approve each wrapper by its exact workflow path and full SHA or tag name.
+ # Tags use GitHub's recorded historical commit, never the tag's current target.
# trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@FULL_COMMIT_SHA
+ # To let one shared wrapper select new pinned evaluator revisions, explicitly delegate:
+ # trusted-wrapper-workflows: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ # delegated-evaluator-wrapper: your-org/shared-ci/.github/workflows/skill-checks.yml@v3
+ # Delegation requires the approved caller's only job to call that wrapper, without a matrix.
+ # Only this wrapper and one pinned evaluator leaf may appear in the historical run.
+ # With delegation, trusted-evaluator-shas may be omitted; caller blob approval stays required.
tools-ref: RELEASE_WORKFLOW_SHA
tools-repository: NVIDIA/SkillEvaluator
diff --git a/docs/cli-onboarding.mdx b/docs/cli-onboarding.mdx
index abd17161..90d507d9 100644
--- a/docs/cli-onboarding.mdx
+++ b/docs/cli-onboarding.mdx
@@ -5,6 +5,7 @@ description: "Install SkillEvaluator, answer a few questions and bring automatic
Bring skill evaluation to your GitHub repository in one guided setup.
SkillEvaluator finds your skills, prepares the workflows and opens a setup PR.
+If your repository already has skill checks, it can add reporting to that setup.
Your CI gets **Tier 1 checks, including SkillSpector security scanning**.
```bash title="Run inside your checked-out GitHub repository"
@@ -12,6 +13,9 @@ pip install --upgrade skillevaluator
skillevaluator ci init
```
+Adding reports to an existing shared component and using private Pages require
+SkillEvaluator **0.7.2 or later**.
+
<CardGroup cols={3}>
<Card title="1. Choose" icon="terminal" href="#run-the-wizard">
Select skill folders, a score threshold and feedback.
@@ -35,23 +39,24 @@ locally. The shared container supplies the runtime; you control the configuratio
Automatic GitHub setup requires repository admin access. GitHub Actions and
the referenced reusable workflows must be allowed. Checks-only setup supports
- public and private repositories. Hosted feedback uses a public repository's
- GitHub Pages site; choose checks only when public report hosting is unsuitable.
+ public and private repositories. Hosted feedback supports public Pages and
+ verified private Pages sites in eligible organization repositories. See
+ [private report hosting](#private-report-hosting) for the one-time prerequisite.
This wizard supports GitHub. For GitLab, use the
[GitLab template](/skills/skillevaluator/gitlab-ci).
</Accordion>
## Run the wizard
-The wizard discovers folders containing `SKILL.md`. Answer five short questions;
-press **Enter** to keep a default.
+For a new scan, the wizard discovers folders containing `SKILL.md`. Answer five
+short questions; press **Enter** to keep a default.
| Question | Your choice |
| --- | --- |
| **Skill folders** | Use the displayed numbers: `1,2` or `1 2` selects two folders. |
| **Minimum score** | `70` by default; a lower quality score fails the check. |
| **PR scope** | `auto` checks changed skills; `all` checks the selected collection. |
-| **Hosted feedback** | Add public HTML reports and one PR comment that updates with new results. |
+| **Hosted feedback** | Add hosted HTML reports and one PR comment that updates with new results. |
| **Apply setup** | Choose `pr`, review the summary, then confirm. |
<Frame caption="Shortened example interview. Folder names and counts come from your repository.">
@@ -69,6 +74,46 @@ Folders [1]: 1,2
The score threshold does not override required security or schema checks.
Default Tier 1 checks use no model key. Tier 2 and Tier 3 are not part of this setup.
+<Note>
+ Already have `.github/workflows/skill-checks.yml`? The CLI recognizes a
+ **Skill checks** workflow with one reusable scan job. It keeps your existing
+ inputs, triggers and workflow reference, including a shared component's `@v3`
+ tag. Review those settings, then choose whether to add hosted feedback.
+ Reporting adds `id-token: write` to the scan job when needed and prepares the
+ publisher workflow.
+</Note>
+
+### Shared components
+
+If your scan calls a shared component such as
+`your-org/ci/.github/workflows/skill-checks.yml@v3`, its maintainer first grants
+`id-token: write` in the component job that calls the evaluator. This is a
+one-time component change; the CLI checks it before applying reporting setup.
+Then run `skillevaluator ci init` in each consuming repository.
+
+The setup keeps `@v3` and approves that component to select the evaluator
+revision. When the maintainer updates `v3`, future scans use the updated
+component without a consumer edit. Each published report retains the resolved
+component and evaluator commits in its execution receipt.
+
+### Private report hosting
+
+Private Pages requires a private or internal project repository owned by a
+GitHub Enterprise Cloud organization. An administrator must first open
+**Settings → Pages**, choose **GitHub Actions** as the source and set the site
+visibility to **Private**. GitHub's REST API cannot change site visibility, so
+this step is done in GitHub's settings.
+
+Rerun `skillevaluator ci init` after that one-time setup. The CLI verifies the
+site's private visibility and uses GitHub's assigned private URL. It can reuse
+an existing SkillEvaluator report site or a newly configured empty private
+site; an unrelated website is preserved.
+
+Personal repositories cannot host access-controlled Pages. If private Pages is
+unavailable, choose **checks only** to retain reports in Actions artifacts.
+Repository privacy alone does not restrict access to a Pages site. See
+[GitHub's private Pages requirements](https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site).
+
## Review your setup
After confirmation, the CLI configures your selected GitHub settings and opens
@@ -158,12 +203,15 @@ extract it and open `index.html`. Failed scans retain their available reports to
</Accordion>
<Accordion title="Can I inspect the setup before applying it?">
Choose the read-only option in the wizard to see the plan without changing
- files or GitHub settings. The `save` option writes only the local workflow
- files; choose `pr` for automatic GitHub setup.
+ files or GitHub settings. Previewing an existing scan workflow makes no
+ network requests; GitHub access and private Pages checks happen when you
+ apply setup. The `save` option writes only the local workflow files; choose
+ `pr` for automatic GitHub setup.
</Accordion>
<Accordion title="Will this change my other workflows or branch rules?">
- Existing workflows remain separate. The CLI does not automatically make
- the scan a required merge check. After the first run, select its emitted
+ The CLI preserves the settings of a recognized existing scan and leaves
+ other workflows separate. It does not automatically make the scan a
+ required merge check. After the first run, select its emitted
check in GitHub branch rules if a failed or incomplete result should block
merging; the current template emits `skills / Tier 1 scan`.
Organization action restrictions are preserved. Repositories using an
diff --git a/docs/developer-guide.mdx b/docs/developer-guide.mdx
index b00c0b70..162e55b8 100644
--- a/docs/developer-guide.mdx
+++ b/docs/developer-guide.mdx
@@ -146,7 +146,7 @@ SkillEvaluator version you used for reproducibility:
cff-version: 1.2.0
title: "SkillEvaluator"
type: software
-version: "0.7.1"
+version: "0.7.2"
preferred-citation:
type: article
title: "Evaluating Skills, Not Just Agents: Agentic Continuous Evaluation of Skills"
diff --git a/docs/github-actions.mdx b/docs/github-actions.mdx
index 094eb933..ef78e912 100644
--- a/docs/github-actions.mdx
+++ b/docs/github-actions.mdx
@@ -22,8 +22,8 @@ The shared image includes **Tier 1 and SkillSpector security scanning**.
### Copy the ready-to-use template
-Open [skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/skill-checks.yml)
-from the [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.1).
+Open [skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/skill-checks.yml)
+from the [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.2).
Use GitHub's **Raw** view to copy it into `.github/workflows/skill-checks.yml`.
The template already supplies pinned workflow and image versions.
@@ -119,11 +119,12 @@ The optional publisher hosts the HTML and posts a comment **after deployment
succeeds**. It needs a second workflow plus one-time hosting and approval settings.
<Card title="Try the guided setup" icon="terminal" href="/skills/skillevaluator/cli-onboarding">
- The CLI prepares those settings and both workflow files, then opens a setup
- PR for you to review.
+ The CLI recognizes an existing single-job scan, keeps its settings and
+ component version tag, and adds reporting in a setup PR. New repositories
+ get both workflows.
</Card>
-Copy [publish-skill-reports.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/publish-skill-reports.yml)
+Copy [publish-skill-reports.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/publish-skill-reports.yml)
from the same template folder as your scan workflow. Complete the one-time setup below,
or let the [CLI](/skills/skillevaluator/cli-onboarding) handle it.
@@ -134,7 +135,9 @@ or let the [CLI](/skills/skillevaluator/cli-onboarding) handle it.
The main steps are:
1. Enable **Settings → Pages → Source: GitHub Actions** and initialize the
- `gh-pages` report-history branch. Preserve any existing site or history.
+ `gh-pages` report-history branch. For private reports, an administrator
+ must also select **Private** site visibility in GitHub's settings; see
+ the private-hosting requirements below. Preserve any existing site or history.
2. Add `publish-skill-reports.yml` with your Pages URL. Keep the evaluator
and publisher versions supplied by the release.
3. Grant the scan workflow `id-token: write`, then approve its exact contents
@@ -157,6 +160,20 @@ or let the [CLI](/skills/skillevaluator/cli-onboarding) handle it.
excerpts and unmerged findings. Use downloadable artifacts when public
hosting is unsuitable.
</Accordion>
+ <Accordion title="Can our private repository publish private reports?">
+ Access-controlled Pages requires a private or internal project repository
+ owned by a GitHub Enterprise Cloud organization. An administrator first
+ selects **GitHub Actions** and **Private** in **Settings → Pages**. The
+ REST API cannot set Pages visibility. Personal repositories cannot host
+ private Pages.
+
+ The CLI verifies the existing private site and uses its assigned
+ `*.pages.github.io` URL. It accepts an existing SkillEvaluator report site
+ or a newly configured empty private site, and preserves unrelated websites.
+ If private hosting is unavailable, choose checks only. See
+ [private report hosting](cli-onboarding.mdx#private-report-hosting) for the
+ guided path and [GitHub's access-control requirements](https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site).
+ </Accordion>
</AccordionGroup>
## Fit it into your workflow
@@ -193,18 +210,30 @@ or let the [CLI](/skills/skillevaluator/cli-onboarding) handle it.
report remains a separate way to inspect available findings.
</Accordion>
<Accordion title="Our organization uses a shared workflow wrapper">
- Each repository still supplies its own skill folders. To publish results
- through a shared wrapper, use a publisher revision with the
- `trusted-wrapper-workflows` input and approve each wrapper by its full
- workflow path and commit SHA. The archived 0.7.1 publisher does not have
- this input. Direct callers need no wrapper approval.
-
- Grant `id-token: write` in the consumer scan job and every wrapper job
- calling the next workflow. Keep the existing evaluator and consumer-file
- approvals, then start a new scan. Follow the
+ Keep the component reference in your existing caller, for example
+ `your-org/ci/.github/workflows/skill-checks.yml@v3`, then run
+ `skillevaluator ci init` in each consumer repository. The CLI recognizes
+ `.github/workflows/skill-checks.yml` with the name **Skill checks** and one
+ reusable scan job. It preserves inputs, triggers and the version tag while
+ adding the publisher and any needed scan-job `id-token: write` permission.
+
+ The component maintainer must first grant `id-token: write` in the job
+ calling the evaluator. The CLI checks that prerequisite before applying
+ reporting setup; a consumer permission alone cannot grant it downstream.
+
+ With delegation, the publisher approves the exact component path and tag
+ in `trusted-wrapper-workflows` and `delegated-evaluator-wrapper`. Updating
+ `v3` then updates future scans centrally, with no consumer workflow edit.
+ Published execution receipts record the resolved component and evaluator
+ commit SHAs for each run. The component still pins its evaluator and image
+ immutably. Use a full component SHA when you want to hold that version fixed.
+
+ Use SkillEvaluator 0.7.2 or later and its reviewed publisher for these delegation inputs; the
+ archived 0.7.1 publisher does not. Direct callers keep an immutable
+ evaluator approval. For manual configuration, follow the
[shared-workflow setup](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/README.md#calling-through-a-shared-workflow)
- for the YAML and update procedure. PR comments still follow successful
- report deployment; internal reports need appropriately restricted hosting.
+ guide. PR comments follow successful report deployment; private reports
+ require the private Pages setup described above.
</Accordion>
<Accordion title="Do the checks need an LLM key or network access?">
Default Tier 1 checks use no model key. Dependency audits can contact
diff --git a/docs/gitlab-ci.mdx b/docs/gitlab-ci.mdx
index 052c33c9..94d7311c 100644
--- a/docs/gitlab-ci.mdx
+++ b/docs/gitlab-ci.mdx
@@ -10,8 +10,8 @@ The shared container includes SkillSpector security scanning.
## Get started
-Copy [gitlab-skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/gitlab-skill-checks.yml)
-from the [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.1).
+Copy [gitlab-skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/gitlab-skill-checks.yml)
+from the [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.2).
It includes the pinned shared configuration and scanner image. You do not need
a GitLab mirror or a local onboarding CLI.
diff --git a/docs/repository-integration.mdx b/docs/repository-integration.mdx
index 06021651..8967ada9 100644
--- a/docs/repository-integration.mdx
+++ b/docs/repository-integration.mdx
@@ -40,10 +40,10 @@ filled-in version, and set your skill folders and score threshold.
| Your platform | Ready-to-use template | Put it in your repository |
| --- | --- | --- |
-| GitHub | [skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
-| GitLab | [gitlab-skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.1/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing root configuration |
+| GitHub | [skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/skill-checks.yml) | `.github/workflows/skill-checks.yml` |
+| GitLab | [gitlab-skill-checks.yml](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/bundles/0.7.2/gitlab-skill-checks.yml) | `.gitlab-ci.yml`, or merge into your existing root configuration |
-The [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.1)
+The [ready-to-use templates](https://github.com/NVIDIA/SkillEvaluator/tree/main/ci/bundles/0.7.2)
include the scan workflows and optional GitHub publisher, with reviewed workflow
and image versions already filled in. Open a file and use GitHub's **Raw** view
to copy its full contents. The [template catalog](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/templates/README.md)
diff --git a/pyproject.toml b/pyproject.toml
index edd44742..282d0dca 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ requires = ["setuptools >= 77", "wheel"]
[project]
name = "skillevaluator"
-version = "0.7.1"
+version = "0.7.2"
description = "Multi-tier framework for evaluating AI agent skills with quality gates, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation."
authors = [{ name = "NVIDIA Corporation" }]
readme = "README.md"
diff --git a/src/skillevaluator/__init__.py b/src/skillevaluator/__init__.py
index 3705e54e..01516a7c 100644
--- a/src/skillevaluator/__init__.py
+++ b/src/skillevaluator/__init__.py
@@ -10,6 +10,6 @@ from importlib.metadata import PackageNotFoundError, version
try:
__version__ = version("skillevaluator")
except PackageNotFoundError:
- __version__ = "0.7.1"
+ __version__ = "0.7.2"
__all__ = ["__version__"]
diff --git a/src/skillevaluator/_ci_onboarding_git.py b/src/skillevaluator/_ci_onboarding_git.py
index d7e6ee85..7f02bb60 100644
--- a/src/skillevaluator/_ci_onboarding_git.py
+++ b/src/skillevaluator/_ci_onboarding_git.py
@@ -121,11 +121,18 @@ def safe_relative(value: str) -> str:
def no_symlinks(repo: Path, relative: str) -> None:
+ import stat
+
current = repo
for part in PurePosixPath(relative).parts:
current /= part
- if current.is_symlink():
- raise SetupError("Symlink paths are not supported by CI onboarding.")
+ try:
+ metadata = current.lstat()
+ except FileNotFoundError:
+ continue
+ reparse = getattr(metadata, "st_file_attributes", 0) & getattr(stat, "FILE_ATTRIBUTE_REPARSE_POINT", 0x400)
+ if stat.S_ISLNK(metadata.st_mode) or reparse:
+ raise SetupError("Symlink and Windows junction paths are not supported by CI onboarding.")
def discover(repo: Path) -> list[dict]:
diff --git a/src/skillevaluator/_ci_onboarding_pages.py b/src/skillevaluator/_ci_onboarding_pages.py
new file mode 100644
index 00000000..d97a4702
--- /dev/null
+++ b/src/skillevaluator/_ci_onboarding_pages.py
@@ -0,0 +1,165 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+"""Read-only validation of public and access-controlled GitHub Pages sites.
+
+Repository visibility and Pages visibility are independent. Never create a site
+for a nonpublic repository here: GitHub's documented REST create/update APIs do
+not accept a Pages visibility setting. An administrator first selects Private
+and GitHub Actions in Settings > Pages, then onboarding can verify and reuse it.
+"""
+
+from __future__ import annotations
+
+import re
+from urllib.parse import urlsplit
+
+from skillevaluator._ci_onboarding_git import SetupError
+
+
+def is_nonpublic(info: dict) -> bool:
+ """Treat missing, inconsistent, and non-boolean privacy data conservatively."""
+ return info.get("private") is not False or info.get("visibility", "public") != "public"
+
+
+def _https_url(value: str) -> tuple[str, str]:
+ """Validate an unambiguous HTTPS URL before using it in generated workflows."""
+ if not isinstance(value, str) or not value or any(ord(char) <= 32 or ord(char) >= 127 for char in value):
+ raise SetupError("The report URL must be an unambiguous HTTPS GitHub Pages URL.")
+ try:
+ parts = urlsplit(value)
+ invalid = (
+ parts.scheme != "https"
+ or not parts.hostname
+ or parts.username is not None
+ or parts.password is not None
+ or parts.port is not None
+ or parts.netloc.endswith(":")
+ or parts.query
+ or parts.fragment
+ or "?" in value
+ or "#" in value
+ or "\\" in value
+ )
+ except ValueError as exc:
+ raise SetupError("The report URL must be an unambiguous HTTPS GitHub Pages URL.") from exc
+ if invalid:
+ raise SetupError("The report URL must be an unambiguous HTTPS GitHub Pages URL.")
+ return parts.hostname, parts.path
+
+
+def _private_url(value: str) -> str:
+ hostname, path = _https_url(value)
+ labels = hostname.split(".")
+ if (
+ not hostname.endswith(".pages.github.io")
+ or len(labels) < 4
+ or len(hostname) > 253
+ or not all(re.fullmatch(r"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?", label) for label in labels)
+ or path not in {"", "/"}
+ ):
+ raise SetupError("The private report URL must be GitHub's HTTPS *.pages.github.io site root.")
+ return f"https://{hostname}/"
+
+
+def report_url(name: str, custom: str | None = None, *, verified_private_url: str | None = None) -> str:
+ """Accept a default public URL, or the exact private URL verified by GitHub.
+
+ ``verified_private_url`` must come from ``private_pages_url`` using an
+ authenticated GET of this repository's Pages resource, never user input.
+ Supplying a private hostname alone does not establish its repository owner.
+ """
+ owner, repo_name = name.split("/")
+ expected = (
+ _private_url(verified_private_url)
+ if verified_private_url is not None
+ else f"https://{owner.lower()}.github.io/{repo_name}/"
+ )
+ value = expected if custom is None else custom
+ _https_url(value)
+ if verified_private_url is not None:
+ value = _private_url(value)
+ if value.removesuffix("/") != expected.removesuffix("/"):
+ raise SetupError("The report URL must match this repository's verified GitHub Pages URL.")
+ return expected
+
+
+def check_private_repository(name: str, info: dict) -> None:
+ """Reject unsupported owners and uncertain permissions before querying Pages."""
+ owner, repo_name = name.split("/")
+ if info.get("private") is not True or info.get("visibility") not in {"private", "internal"}:
+ raise SetupError(
+ "GitHub did not confirm this repository is private or internal; inspect its visibility or use --checks-only."
+ )
+ if not isinstance(info.get("owner"), dict) or info["owner"].get("type") != "Organization":
+ raise SetupError(
+ "Private Pages requires a private or internal project repository owned by a GitHub Enterprise Cloud "
+ "organization. Personal repositories cannot publish private Pages. Use --checks-only to keep reports "
+ "in Actions artifacts."
+ )
+ if repo_name.lower() == f"{owner.lower()}.github.io":
+ raise SetupError(
+ "Private Pages access control is unavailable for an organization site. Use an organization project "
+ "repository, or --checks-only to keep reports in Actions artifacts."
+ )
+ if not isinstance(info.get("permissions"), dict) or info["permissions"].get("admin") is not True:
+ raise SetupError(
+ "Private Pages setup requires repository admin access and a token with Pages and Administration "
+ "permissions. Ask an owner to configure the site, or use --checks-only."
+ )
+
+
+def private_pages_url(name: str, info: dict, pages: dict | None) -> str:
+ """Return the verified private origin or explain the prerequisite to fix.
+
+ The caller owns API reads and existing history verification. This function
+ makes no request and does not infer access control from repository privacy,
+ URL shape, a missing resource, or a plan name.
+ """
+ check_private_repository(name, info)
+ settings = f"https://github.com/{name}/settings/pages"
+ if not isinstance(pages, dict) or pages.get("public") is not False:
+ raise SetupError(
+ "GitHub has not verified a private Pages site for this repository. Open "
+ f"{settings}, select Private visibility and GitHub Actions as the source, then rerun setup. "
+ "Private visibility requires GitHub Enterprise Cloud and organization policy that allows private Pages. "
+ "If the option is unavailable, ask an organization owner or use --checks-only. "
+ "A public site will not be created."
+ )
+ if pages.get("build_type") not in {"workflow", "legacy"} or pages.get("cname"):
+ raise SetupError(
+ "The existing private Pages configuration is outside SkillEvaluator's setup. "
+ "Use the default GitHub private domain and GitHub Actions source, or use --checks-only."
+ )
+ return _private_url(pages.get("html_url"))
+
+
+def check_site(name: str, pages: dict | None, *, history_exists: bool, deployments: list | None = None) -> None:
+ """Protect existing content while allowing a fresh private Actions site.
+
+ ``history_exists`` must be the result of the caller's ownership check: False
+ means no gh-pages branch exists, not an existing unowned or invalid branch.
+ For adoption, ``deployments`` must come from an authenticated, unfiltered
+ listing of this repository's deployments. Pages can use any environment,
+ so checking only github-pages cannot establish emptiness. None means not
+ verified.
+ """
+ if pages is None:
+ return
+ if not isinstance(pages, dict) or pages.get("build_type") not in {"workflow", "legacy"} or pages.get("cname"):
+ raise SetupError("An existing Pages site is outside SkillEvaluator's setup. It will not be replaced.")
+ if history_exists:
+ return
+ if (
+ pages.get("public") is False
+ and pages.get("build_type") == "workflow"
+ and "status" in pages
+ and pages["status"] is None
+ and isinstance(deployments, list)
+ and not deployments
+ ):
+ return
+ raise SetupError(
+ "An existing Pages site is not owned by SkillEvaluator and is not verified as a fresh empty private site. "
+ "Its content will not be replaced. Use --checks-only or a fresh private Pages project site at "
+ f"https://github.com/{name}/settings/pages."
+ )
diff --git a/src/skillevaluator/_ci_onboarding_workflows.py b/src/skillevaluator/_ci_onboarding_workflows.py
new file mode 100644
index 00000000..fba8677a
--- /dev/null
+++ b/src/skillevaluator/_ci_onboarding_workflows.py
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Conservative onboarding of an existing, reviewable Skill checks caller."""
+
+from __future__ import annotations
+
+import re
+from dataclasses import dataclass
+
+import yaml
+
+from skillevaluator._ci_onboarding_git import SetupError, safe_relative
+
+EVALUATOR = "NVIDIA/SkillEvaluator/.github/workflows/evaluate-skills.yml"
+WORKFLOW = re.compile(
+ r"(?P<repository>[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*)/"
+ r"(?P<path>\.github/workflows/[A-Za-z0-9_-][A-Za-z0-9_.-]*\.ya?ml)@"
+ r"(?P<ref>[0-9a-f]{40}|v[0-9]+(?:\.[0-9]+)*)"
+)
+
+
+class WorkflowLoader(yaml.SafeLoader):
+ """Read workflow keys such as 'on' without YAML 1.1 boolean coercion."""
+
+
+WorkflowLoader.yaml_implicit_resolvers = {
+ key: [(tag, pattern) for tag, pattern in values if tag != "tag:yaml.org,2002:bool"]
+ for key, values in yaml.SafeLoader.yaml_implicit_resolvers.items()
+}
+WorkflowLoader.add_implicit_resolver(
+ "tag:yaml.org,2002:bool", re.compile(r"^(?:true|false)$", re.IGNORECASE), list("tTfF")
+)
+
+
+def _mapping(loader, node, deep=False):
+ result = {}
+ for key_node, value_node in node.value:
+ key = loader.construct_object(key_node, deep=deep)
+ if not isinstance(key, str) or key in result or key == "<<":
+ raise SetupError("Workflow YAML must use unique string keys without merge aliases.")
+ result[key] = loader.construct_object(value_node, deep=deep)
+ return result
+
+
+WorkflowLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, _mapping)
+
+
+def parse_workflow(content: str) -> dict:
+ try:
+ if len(content.encode()) > 128 * 1024:
+ raise SetupError("Workflow exceeds the onboarding size limit.")
+ if any(
+ isinstance(event, yaml.AliasEvent) or getattr(event, "anchor", None) or getattr(event, "tag", None)
+ for event in yaml.parse(content)
+ ):
+ raise SetupError(
+ "Workflow aliases or explicit YAML tags require manual review before automatic onboarding."
+ )
+ result = yaml.load(content, Loader=WorkflowLoader)
+ except (yaml.YAMLError, RecursionError) as exc:
+ raise SetupError("The existing scan workflow is not valid, bounded YAML.") from exc
+ if not isinstance(result, dict):
+ raise SetupError("The existing scan workflow must be a YAML mapping.")
+ return result
+
+
+def identity_allowed(workflow: dict, job: dict) -> bool:
+ permission = job.get("permissions", workflow.get("permissions", {}))
+ return permission == "write-all" or (isinstance(permission, dict) and permission.get("id-token") == "write")
+
+
+@dataclass(frozen=True)
+class ExistingScan:
+ text: str
+ data: dict
+ job: str
+ uses: str
+ roots: list[str]
+ score: int
+ scan_mode: str
+ evaluator_sha: str | None
+ delegated_wrapper: str | None
+
+ def with_identity_permission(self) -> str:
+ job = self.data["jobs"][self.job]
+ if identity_allowed(self.data, job):
+ return self.text
+ permissions = job.get("permissions", self.data.get("permissions", {"contents": "read"}))
+ if not isinstance(permissions, dict):
+ raise SetupError("Use an explicit permissions mapping before adding reporting to this workflow.")
+ # The only semantic change is the permission required for a signed scan
+ # receipt. Preserve all other text, including triggers and team comments.
+ tree = yaml.compose(self.text, Loader=WorkflowLoader)
+ jobs = next(value for key, value in tree.value if key.value == "jobs")
+ node = next(value for key, value in jobs.value if key.value == self.job)
+ permission_node = next((value for key, value in node.value if key.value == "permissions"), None)
+ updated = {**permissions, "id-token": "write"}
+ if permission_node is None:
+ if node.flow_style:
+ raise SetupError("Expand the existing scan job to block YAML before adding its identity permission.")
+ at = node.start_mark.index
+ indent = node.start_mark.column
+ lines = ["permissions:"] + [" " + line for line in yaml.safe_dump(updated, sort_keys=False).splitlines()]
+ insertion = ("\n" + " " * indent).join(lines) + "\n" + " " * indent
+ return self.text[:at] + insertion + self.text[at:]
+ # A compact mapping avoids changing indentation or eating the next key.
+ replacement = yaml.safe_dump(updated, default_flow_style=True, sort_keys=False, width=1000).strip()
+ start, end = permission_node.start_mark.index, permission_node.end_mark.index
+ if not permission_node.flow_style:
+ replacement += "\n" + " " * permission_node.end_mark.column
+ return self.text[:start] + replacement + self.text[end:]
+
+
+def existing_scan(content: str) -> ExistingScan:
+ data = parse_workflow(content)
+ jobs = data.get("jobs")
+ if data.get("name") != "Skill checks" or not isinstance(jobs, dict) or len(jobs) != 1:
+ raise SetupError("Automatic reporting expects a 'Skill checks' workflow with one reusable scan job.")
+ job_id, job = next(iter(jobs.items()))
+ if not isinstance(job, dict) or "strategy" in job or "secrets" in job:
+ raise SetupError("Matrix or secret-passing scan callers require manual reporting setup.")
+ uses = job.get("uses")
+ match = WORKFLOW.fullmatch(uses) if isinstance(uses, str) else None
+ if not match:
+ raise SetupError("The existing scan must call a full-SHA workflow or an approved version tag such as @v3.")
+ inputs = job.get("with", {})
+ if not isinstance(inputs, dict) or not isinstance(inputs.get("paths"), str) or "${{" in inputs["paths"]:
+ raise SetupError("The existing scan must specify literal repository-relative skill folders in 'paths'.")
+ roots = list(dict.fromkeys(safe_relative(path.strip()) for path in inputs["paths"].splitlines() if path.strip()))
+ score, mode = inputs.get("min-score", 70), inputs.get("scan-mode", "auto")
+ if not roots or type(score) is not int or not 0 <= score <= 100 or mode not in {"auto", "all"}:
+ raise SetupError("The existing scan has unsupported paths, minimum score, or scan mode.")
+ direct = uses.split("@")[0] == EVALUATOR
+ if direct and not re.fullmatch(r"[0-9a-f]{40}", match["ref"]):
+ raise SetupError("Direct evaluator workflows must retain an immutable full commit SHA.")
+ return ExistingScan(
+ content, data, job_id, uses, roots, score, mode, match["ref"] if direct else None, None if direct else uses
+ )
diff --git a/src/skillevaluator/ci-release.json b/src/skillevaluator/ci-release.json
index 6651a372..d736457d 100644
--- a/src/skillevaluator/ci-release.json
+++ b/src/skillevaluator/ci-release.json
@@ -1,7 +1,7 @@
{
"repository": "NVIDIA/SkillEvaluator",
"workflow_ref": "46a8cf269257d1ec56a0285c508ac9ee48010930",
- "publisher_ref": "46a8cf269257d1ec56a0285c508ac9ee48010930",
+ "publisher_ref": "8096c6966a498f35f6f7dc1a596d1cc4da85cf11",
"image": "ghcr.io/nvidia/skillevaluator-tier1@sha256:a3baec51f48145cdf9de05a5ab054d9576f62f1de0f5276b788410f5c17747d4",
"schema_version": 1
}
diff --git a/src/skillevaluator/ci_onboarding.py b/src/skillevaluator/ci_onboarding.py
index 3f80794f..b4b98dd3 100644
--- a/src/skillevaluator/ci_onboarding.py
+++ b/src/skillevaluator/ci_onboarding.py
@@ -13,7 +13,7 @@ import subprocess
import sys
import tempfile
from pathlib import Path, PurePosixPath
-from urllib.parse import quote, urlsplit
+from urllib.parse import quote
import click
import yaml
@@ -23,6 +23,8 @@ from rich.table import Table
from rich.text import Text
from skillevaluator import _ci_onboarding_git as git_helpers
+from skillevaluator import _ci_onboarding_pages as pages_helpers
+from skillevaluator import _ci_onboarding_workflows as workflow_helpers
SCAN = ".github/workflows/skill-checks.yml"
PUBLISH = ".github/workflows/publish-skill-reports.yml"
@@ -135,22 +137,8 @@ def load_release(path: Path) -> dict:
return data
-def report_url(name: str, custom: str | None = None) -> str:
- owner, repo_name = name.split("/")
- expected = f"https://{owner.lower()}.github.io/{repo_name}/"
- value = custom or expected
- parts = urlsplit(value)
- if (
- parts.scheme != "https"
- or parts.username
- or parts.password
- or parts.port
- or parts.query
- or parts.fragment
- or value.rstrip("/") != expected.rstrip("/")
- ):
- raise SetupError("The report URL must be this repository's default HTTPS GitHub Pages URL.")
- return expected
+def report_url(name: str, custom: str | None = None, *, verified_private_url: str | None = None) -> str:
+ return pages_helpers.report_url(name, custom, verified_private_url=verified_private_url)
def blob_id(content: str) -> str:
@@ -162,6 +150,37 @@ def yaml_text(value: dict) -> str:
return yaml.dump(value, Dumper=git_helpers.WorkflowDumper, sort_keys=False, allow_unicode=True, width=1000)
+def committed_blob(repo: Path, path: str, content: str) -> str:
+ """Hash using the same path filters Git applies when staging this file."""
+ with tempfile.TemporaryDirectory(prefix="skill-caller-blob-") as temporary:
+ source = Path(temporary) / "scan.yml"
+ source.write_bytes(content.encode("utf-8"))
+ blob = git_helpers.git(repo, "hash-object", "--path", path, "--", str(source)).strip()
+ if not re.fullmatch(r"[0-9a-f]{40}", blob):
+ raise SetupError("Git did not return the scan workflow's commit identity.")
+ return blob
+
+
+def bind_caller_approval(repo: Path, files: dict[str, str]) -> dict[str, str]:
+ """Approve the bytes Git will commit, including configured line endings."""
+ if PUBLISH not in files:
+ return files
+ blob = committed_blob(repo, SCAN, files[SCAN])
+ publisher = workflow_helpers.parse_workflow(files[PUBLISH])
+ publisher["jobs"]["reports"]["with"]["trusted-caller-blobs"] = blob
+ return {
+ **files,
+ PUBLISH: "# Generated by SkillEvaluator CI onboarding; publisher pinned to a verified commit.\n"
+ + yaml_text(publisher),
+ }
+
+
+def caller_approval(files: dict[str, str]) -> str:
+ if PUBLISH in files:
+ return workflow_helpers.parse_workflow(files[PUBLISH])["jobs"]["reports"]["with"]["trusted-caller-blobs"]
+ return blob_id(files[SCAN])
+
+
def render_files(
release: dict,
roots: list[str],
@@ -171,8 +190,18 @@ def render_files(
name: str,
full: bool = True,
url: str | None = None,
+ *,
+ existing: workflow_helpers.ExistingScan | None = None,
+ verified_private_url: str | None = None,
) -> dict[str, str]:
- url = report_url(name, url) if full else None
+ url = report_url(name, url, verified_private_url=verified_private_url) if full else None
+ if (
+ full
+ and existing
+ and existing.data["jobs"][existing.job]["with"].get("artifact-name", "skill-evaluator-tier1")
+ != "skill-evaluator-tier1"
+ ):
+ raise SetupError("Reporting requires artifact-name: skill-evaluator-tier1 in the existing scan.")
scan = {
"name": "Skill checks",
"on": {"pull_request": None, "push": {"branches": [branch]}, "workflow_dispatch": None},
@@ -193,7 +222,11 @@ def render_files(
if full:
scan["permissions"]["id-token"] = "write"
scan["jobs"]["skills"]["with"]["report-base-url"] = url
- scan_text = "# Generated by SkillEvaluator CI onboarding.\n" + yaml_text(scan)
+ scan_text = (
+ (existing.with_identity_permission() if full else existing.text)
+ if existing
+ else "# Generated by SkillEvaluator CI onboarding.\n" + yaml_text(scan)
+ )
files = {SCAN: scan_text}
if full:
publisher = {
@@ -221,7 +254,7 @@ def render_files(
"run-id": "${{ format('{0}', github.event.workflow_run.id || inputs.run-id) }}",
"run-attempt": "${{ format('{0}', github.event.workflow_run.run_attempt || inputs.run-attempt) }}",
"report-base-url": url,
- "trusted-evaluator-shas": release["workflow_ref"],
+ "trusted-evaluator-shas": existing.evaluator_sha if existing else release["workflow_ref"],
"trusted-caller-blobs": blob_id(scan_text),
"tools-ref": release["publisher_ref"],
"tools-repository": release["repository"],
@@ -229,6 +262,11 @@ def render_files(
}
},
}
+ if existing and existing.delegated_wrapper:
+ inputs = publisher["jobs"]["reports"]["with"]
+ inputs.pop("trusted-evaluator-shas")
+ inputs["trusted-wrapper-workflows"] = existing.delegated_wrapper
+ inputs["delegated-evaluator-wrapper"] = existing.delegated_wrapper
files[PUBLISH] = (
"# Generated by SkillEvaluator CI onboarding; publisher pinned to a verified commit.\n"
+ yaml_text(publisher)
@@ -236,37 +274,155 @@ def render_files(
return files
-def check_files(repo: Path, files: dict[str, str]) -> list[str]:
+def check_files(repo: Path, files: dict[str, str], expected: dict[str, str] | None = None) -> list[str]:
changed = []
for name, content in files.items():
git_helpers.no_symlinks(repo, name)
target = repo / name
if target.exists():
if not target.is_file() or target.read_bytes() != content.encode():
- raise SetupError(f"{name} already exists with different content; it will not be replaced.")
+ if (
+ not target.is_file()
+ or name not in (expected or {})
+ or target.read_bytes() != expected[name].encode()
+ ):
+ raise SetupError(f"{name} already exists with different content; it will not be replaced.")
+ changed.append(name)
else:
changed.append(name)
return changed
-def save_files(repo: Path, files: dict[str, str]) -> None:
- missing = check_files(repo, files)
+def save_files(repo: Path, files: dict[str, str], expected: dict[str, str] | None = None) -> None:
+ import stat
+ import uuid
+ from contextlib import suppress
+
+ missing = check_files(repo, files, expected)
if not missing:
return
git_helpers.require_clean(repo)
+ directory_handles = []
written = []
+
+ def parent_handle(target: Path):
+ git_helpers.no_symlinks(repo, target.relative_to(repo).as_posix())
+ if os.open not in os.supports_dir_fd or not hasattr(os, "O_NOFOLLOW"):
+ target.parent.mkdir(parents=True, exist_ok=True)
+ git_helpers.no_symlinks(repo, target.relative_to(repo).as_posix())
+ return None
+ flags = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW
+ handle = os.open(repo, flags)
+ try:
+ for part in target.relative_to(repo).parts[:-1]:
+ try:
+ child = os.open(part, flags, dir_fd=handle)
+ except FileNotFoundError:
+ os.mkdir(part, dir_fd=handle)
+ child = os.open(part, flags, dir_fd=handle)
+ os.close(handle)
+ handle = child
+ except BaseException:
+ os.close(handle)
+ raise
+ directory_handles.append(handle)
+ return handle
+
+ def validate_parent(target: Path, handle) -> None:
+ git_helpers.no_symlinks(repo, target.relative_to(repo).as_posix())
+ if handle is not None:
+ current, opened = target.parent.stat(), os.fstat(handle)
+ if (current.st_dev, current.st_ino) != (opened.st_dev, opened.st_ino):
+ raise SetupError("A workflow directory changed during setup; no replacement was approved.")
+
+ def snapshot(target: Path, handle):
+ validate_parent(target, handle)
+ kwargs = {"dir_fd": handle} if handle is not None else {}
+ path = target.name if handle is not None else target
+ flags = os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0) | getattr(os, "O_NONBLOCK", 0) | getattr(os, "O_BINARY", 0)
+ try:
+ descriptor = os.open(path, flags, **kwargs)
+ except FileNotFoundError:
+ return None
+ with os.fdopen(descriptor, "rb") as stream:
+ metadata = os.fstat(stream.fileno())
+ if not stat.S_ISREG(metadata.st_mode):
+ raise SetupError("The workflow target is not a regular file.")
+ content = stream.read()
+ return content, stat.S_IMODE(metadata.st_mode), metadata.st_dev, metadata.st_ino
+
+ def replace(target: Path, handle, content: bytes, previous):
+ validate_parent(target, handle)
+ stage_name = f".skillevaluator-{uuid.uuid4().hex}.tmp"
+ stage = stage_name if handle is not None else target.parent / stage_name
+ destination = target.name if handle is not None else target
+ kwargs = {"dir_fd": handle} if handle is not None else {}
+ pair_kwargs = {"src_dir_fd": handle, "dst_dir_fd": handle} if handle is not None else {}
+ flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, "O_NOFOLLOW", 0) | getattr(os, "O_BINARY", 0)
+ descriptor = os.open(stage, flags, previous[1] if previous is not None else 0o644, **kwargs)
+ try:
+ with os.fdopen(descriptor, "wb") as stream:
+ stream.write(content)
+ stream.flush()
+ if previous is not None:
+ if hasattr(os, "fchmod"):
+ os.fchmod(stream.fileno(), previous[1])
+ else:
+ Path(stage).chmod(previous[1])
+ metadata = os.fstat(stream.fileno())
+ if snapshot(target, handle) != previous:
+ raise SetupError("A workflow changed during setup; no replacement was approved.")
+ validate_parent(target, handle)
+ if previous is None:
+ # Hard-link publication is exclusive: a concurrently created
+ # target is never overwritten, even after the last readback.
+ os.link(stage, destination, **pair_kwargs)
+ else:
+ # Replace the directory entry, never write through a target
+ # that could have become a symlink after its final readback.
+ os.replace(stage, destination, **pair_kwargs) # noqa: PTH105 -- preserve directory-descriptor binding
+ return content, stat.S_IMODE(metadata.st_mode), metadata.st_dev, metadata.st_ino
+ finally:
+ # Cleanup must not follow a redirected parent or turn a completed
+ # replacement into an untracked write if unlinking the temp fails.
+ with suppress(OSError, SetupError):
+ if handle is None:
+ validate_parent(target, handle)
+ os.unlink(stage, **kwargs)
+
try:
for name in missing:
target = repo / name
- target.parent.mkdir(parents=True, exist_ok=True)
- with target.open("x", encoding="utf-8", newline="\n") as stream:
- stream.write(files[name])
- written.append(target)
- except OSError:
- # Undo only files exclusively created by this invocation.
- for target in written:
- target.unlink()
+ handle = parent_handle(target)
+ previous = snapshot(target, handle)
+ if previous is None and name in (expected or {}):
+ raise SetupError("A workflow disappeared during setup; no replacement was approved.")
+ if previous is not None and (name not in (expected or {}) or previous[0] != expected[name].encode()):
+ raise SetupError("A workflow changed during setup; no replacement was approved.")
+ installed = replace(target, handle, files[name].encode(), previous)
+ written.append((target, handle, previous, installed))
+ except (OSError, SetupError) as exc:
+ incomplete = False
+ for target, handle, previous, installed in reversed(written):
+ try:
+ if snapshot(target, handle) != installed:
+ incomplete = True
+ continue
+ if previous is None:
+ os.unlink(target.name, dir_fd=handle) if handle is not None else target.unlink()
+ else:
+ replace(target, handle, previous[0], installed)
+ except (OSError, SetupError):
+ incomplete = True
+ if incomplete:
+ raise SetupError(
+ "Workflow saving failed and a target changed concurrently. Changed targets were left untouched; "
+ "inspect the checkout before retrying."
+ ) from exc
raise
+ finally:
+ for handle in directory_handles:
+ os.close(handle)
def github_api(method: str, endpoint: str, payload: dict | None = None, *, missing_ok=False):
@@ -348,10 +504,19 @@ def remote_preflight(repo: Path, name: str, branch: str, full: bool) -> dict:
raise SetupError(
"Automatic GitHub setup requires repository admin access. Use --mode save to prepare files for an owner."
)
- if full and (info.get("private") is not False or info.get("visibility", "public") != "public"):
- raise SetupError(
- "Automatic hosted reports support public repositories only. Use --checks-only for private or internal repositories; their reports stay in Actions artifacts."
- )
+ pages = None
+ private_url = None
+ if full and pages_helpers.is_nonpublic(info):
+ pages_helpers.check_private_repository(name, info)
+ try:
+ pages = github_api("GET", f"repos/{name}/pages", missing_ok=True)
+ except SetupError as exc:
+ raise SetupError(
+ "Private Pages could not be verified. Check your gh login, Pages read permission, and repository "
+ "admin access. Private hosting requires an Enterprise Cloud organization that allows private Pages; "
+ "use --checks-only to keep reports in Actions artifacts."
+ ) from exc
+ private_url = pages_helpers.private_pages_url(name, info, pages)
if info["default_branch"] != branch:
raise SetupError("The selected branch differs from GitHub's default branch. Use --default-branch.")
canonical = f"https://github.com/{name}.git"
@@ -368,16 +533,22 @@ def remote_preflight(repo: Path, name: str, branch: str, full: bool) -> dict:
raise SetupError(
"This repository restricts external actions. Automatic setup preserves that policy; use --mode save and have an owner review the workflow allowlist."
)
- state = {"info": info, "actions": actions, "history_exists": False, "pages": None}
+ state = {
+ "info": info,
+ "actions": actions,
+ "history_exists": False,
+ "pages": pages,
+ "verified_private_url": private_url,
+ "report_url": report_url(name, verified_private_url=private_url) if full else None,
+ }
if full:
state["history_exists"] = history_preflight(name)
- state["pages"] = github_api("GET", f"repos/{name}/pages", missing_ok=True)
- if state["pages"] is not None and (
- not state["history_exists"]
- or state["pages"].get("build_type") not in {"workflow", "legacy"}
- or state["pages"].get("cname")
- ):
- raise SetupError("An existing Pages site is outside SkillEvaluator's setup. It will not be replaced.")
+ if private_url is None:
+ state["pages"] = github_api("GET", f"repos/{name}/pages", missing_ok=True)
+ deployments = None
+ if private_url is not None and not state["history_exists"]:
+ deployments = github_api("GET", f"repos/{name}/deployments?per_page=1")
+ pages_helpers.check_site(name, state["pages"], history_exists=state["history_exists"], deployments=deployments)
return state
@@ -402,7 +573,7 @@ def branch_preflight(
if sorted(changed) != sorted(changed_files):
raise SetupError("The existing setup branch has other changes; it will not be reused.")
for path, content in files.items():
- if git_helpers.git(repo, "show", f"FETCH_HEAD:{path}") != content:
+ if git_helpers.git(repo, "rev-parse", f"FETCH_HEAD:{path}").strip() != committed_blob(repo, path, content):
raise SetupError("The existing setup branch has a different configuration; it will not be replaced.")
return {"pr_url": prs[0]["url"] if prs else None}
@@ -461,6 +632,15 @@ def ensure_environment(name: str, branch: str) -> None:
def enable_hosting(repo: Path, name: str, branch: str, state: dict, progress: list[str]) -> None:
+ private_url = state.get("verified_private_url")
+ if private_url is not None or ("info" in state and pages_helpers.is_nonpublic(state["info"])):
+ private_url = pages_helpers.private_pages_url(name, state.get("info", {}), state["pages"])
+ current = github_api("GET", f"repos/{name}/pages", missing_ok=True)
+ if pages_helpers.private_pages_url(name, state["info"], current) != private_url:
+ raise SetupError("The private Pages URL changed after preflight; rerun setup before publishing.")
+ expected_url = report_url(name, verified_private_url=private_url)
+ if state.get("report_url", expected_url) != expected_url:
+ raise SetupError("Pages preflight does not match the requested report URL; rerun setup.")
if not state["actions"].get("enabled"):
github_api("PUT", f"repos/{name}/actions/permissions", {"enabled": True, "allowed_actions": "all"})
progress.append("GitHub Actions enabled")
@@ -475,22 +655,72 @@ def enable_hosting(repo: Path, name: str, branch: str, state: dict, progress: li
github_api("PUT", f"repos/{name}/pages", {"build_type": "workflow"})
progress.append("Owned report site switched to Actions source")
pages = github_api("GET", f"repos/{name}/pages")
+ if private_url is not None and pages_helpers.private_pages_url(name, state["info"], pages) != private_url:
+ raise SetupError("The private Pages URL changed after preflight; rerun setup before publishing.")
if (
pages.get("build_type") != "workflow"
or pages.get("cname")
- or report_url(name, pages.get("html_url")) != report_url(name)
+ or not isinstance(pages.get("html_url"), str)
+ or report_url(name, pages["html_url"], verified_private_url=private_url) != expected_url
):
raise SetupError("Pages readback does not match the requested workflow report site.")
if not state["history_exists"]:
+ if private_url is not None:
+ deployments = github_api("GET", f"repos/{name}/deployments?per_page=1")
+ pages_helpers.check_site(name, pages, history_exists=False, deployments=deployments)
initialize_history(repo, name)
progress.append("Report history branch initialized")
ensure_environment(name, branch)
progress.append("Pages deployment allowed from the default branch")
-def create_setup(repo: Path, name: str, branch: str, files: dict[str, str], full: bool, plan: dict) -> str | None:
+def component_preflight(existing: workflow_helpers.ExistingScan | None) -> None:
+ """Use the operator's login to check the shared component once, before writes."""
+ if not existing or not existing.delegated_wrapper:
+ return
+ match = workflow_helpers.WORKFLOW.fullmatch(existing.uses)
+ repository, path, ref = match["repository"], match["path"], match["ref"]
+ if ref.startswith("v"):
+ tag = github_api("GET", f"repos/{repository}/git/ref/tags/{quote(ref, safe='')}")
+ obj = tag.get("object", {})
+ for _ in range(5):
+ if obj.get("type") != "tag":
+ break
+ obj = github_api("GET", f"repos/{repository}/git/tags/{obj['sha']}").get("object", {})
+ if obj.get("type") != "commit" or not re.fullmatch(r"[0-9a-f]{40}", str(obj.get("sha", ""))):
+ raise SetupError("The component version must resolve to a Git commit tag.")
+ ref = obj["sha"]
+ value = github_api("GET", f"repos/{repository}/contents/{path}?ref={ref}")
+ data = workflow_helpers.parse_workflow(decode_content(value).decode("utf-8"))
+ jobs = data.get("jobs")
+ if not isinstance(jobs, dict) or len(jobs) != 1:
+ raise SetupError("Automatic reporting currently supports a component with one direct evaluator job.")
+ job_id, job = next(iter(jobs.items()))
+ if (
+ not isinstance(job, dict)
+ or not re.fullmatch(re.escape(workflow_helpers.EVALUATOR) + r"@[0-9a-f]{40}", str(job.get("uses", "")))
+ or "strategy" in job
+ ):
+ raise SetupError("The shared component must call one SHA-pinned NVIDIA SkillEvaluator workflow.")
+ if not workflow_helpers.identity_allowed(data, job):
+ raise SetupError(
+ f"The shared component needs one central update: grant 'id-token: write' alongside 'contents: read' "
+ f"on job '{job_id}' in {repository}/{path}, then update its approved version and rerun this command. "
+ "This lets scans sign their report identity. No repository settings were changed."
+ )
+ if job.get("with", {}).get("artifact-name", "skill-evaluator-tier1") != "skill-evaluator-tier1":
+ raise SetupError("The shared component must keep artifact-name: skill-evaluator-tier1 for reporting.")
+
+
+def create_setup(
+ repo: Path, name: str, branch: str, files: dict[str, str], full: bool, plan: dict, *, expected=None
+) -> str | None:
git_helpers.require_identity(repo)
state = remote_preflight(repo, name, branch, full)
+ if full and state.get("report_url") != plan["report_url"]:
+ raise SetupError("The report site changed after preview. Rerun setup to review its current URL.")
+ if full and expected and SCAN in expected:
+ component_preflight(workflow_helpers.existing_scan(expected[SCAN]))
existing = branch_preflight(repo, name, branch, files, plan["changed_files"]) if plan["changed_files"] else None
progress = plan.setdefault("completed_steps", [])
if full:
@@ -512,7 +742,7 @@ def create_setup(repo: Path, name: str, branch: str, files: dict[str, str], full
try:
git_helpers.git(repo, "worktree", "add", "--detach", str(work), f"origin/{branch}")
added = True
- save_files(work, files)
+ save_files(work, files, expected)
git_helpers.git(work, "add", "--", *files)
git_helpers.git(
work,
@@ -543,8 +773,13 @@ def create_setup(repo: Path, name: str, branch: str, files: dict[str, str], full
if full
else "Download the HTML from Actions.\n\n"
)
- + "Generated by SkillEvaluator CI onboarding with immutable workflow and image versions. "
- "This setup PR is not an evaluation pass. Existing workflows and merge rules are preserved.\n",
+ + "Generated by SkillEvaluator CI onboarding. "
+ + (
+ f"The approved shared component `{plan['component']}` maintains evaluator versions and policy. "
+ if plan.get("component")
+ else "Evaluator workflow and image versions are pinned. "
+ )
+ + "This setup PR is not an evaluation pass. Existing workflows and merge rules are preserved.\n",
)
url = git_helpers.run(
[
@@ -661,6 +896,13 @@ def init(
name = git_helpers.parse_remote(git_helpers.git(repo, "remote", "get-url", "origin").strip())
branch = git_helpers.infer_branch(repo, default_branch)
roots = git_helpers.discover(repo)
+ git_helpers.no_symlinks(repo, SCAN)
+ existing = (
+ workflow_helpers.existing_scan((repo / SCAN).read_bytes().decode("utf-8"))
+ if (repo / SCAN).exists()
+ else None
+ )
+ expected = {SCAN: existing.text} if existing else None
console.print("Bring SkillEvaluator to your repository", style="bold green")
console.print("GitHub | Tier 1 + SkillSpector | no model key", style="dim")
console.print(f"{name} | {branch}", markup=False)
@@ -675,14 +917,38 @@ def init(
selection_hint += " Enter accepts the default."
else:
selection_hint += "\nNo default: enter a number to continue."
- question(1, "Which skill folders?", table, selection_hint)
- selected = select_roots(roots, paths, no_input)
- selected_count = sum(item["count"] for item in roots if item["root"] in selected)
+ if existing:
+ question(
+ 1,
+ "Keep your existing skill checks",
+ Text(existing.uses),
+ "Your folders, thresholds and triggers stay as configured.",
+ )
+ if paths or min_score is not None or scan_mode is not None:
+ raise SetupError(
+ "Edit the existing scan workflow to change its policy; onboarding preserves that configuration."
+ )
+ selected = existing.roots
+ manifests = git_helpers.git(repo, "ls-files", "-z", "--cached").split("\0")
+ selected_count = sum(
+ PurePosixPath(path).name == "SKILL.md"
+ and any(root == "." or path.startswith(root + "/") for root in selected)
+ for path in manifests
+ if path
+ )
+ if not 1 <= selected_count <= 100:
+ raise SetupError("The existing scan must select between 1 and 100 tracked skills.")
+ else:
+ question(1, "Which skill folders?", table, selection_hint)
+ selected = select_roots(roots, paths, no_input)
+ selected_count = sum(item["count"] for item in roots if item["root"] in selected)
console.print(f"{symbol('✓', '[OK]')} Selected: {', '.join(selected)} ({selected_count} skills)", markup=False)
question(2, "Minimum quality score?", "Fail below this score (0-100). Other required checks also apply.")
score = (
- min_score
- if min_score is not None
+ existing.score
+ if existing
+ else min_score
+ if existing or min_score is not None
else (70 if no_input else click.prompt("Score", default=70, type=click.IntRange(0, 100)))
)
question(
@@ -691,20 +957,28 @@ def init(
"auto = changed skills (recommended)\nall = every skill in your selected folders",
)
scan = (
- scan_mode
- if scan_mode is not None
+ existing.scan_mode
+ if existing
+ else scan_mode
+ if existing or scan_mode is not None
else ("auto" if no_input else click.prompt("PR scope", default="auto", type=click.Choice(["auto", "all"])))
)
question(
4,
"Add hosted reports and PR comments?",
- "Always included: checks + downloadable HTML.\nOptional: a public report site + one updated PR comment.",
+ "Always included: checks + downloadable HTML.\nOptional: hosted HTML + one updated PR comment. Private repos require private Pages.",
)
if full is None:
full = True if no_input else click.confirm("Add hosted feedback?", default=True)
- url = report_url(name, custom_url) if full else None
- files = render_files(release, selected, score, scan, branch, name, full, url)
- changed = check_files(repo, files)
+ # Private site URLs are bound to an authenticated Pages readback in PR
+ # mode below. Offline preview/save never treats a typed URL as verified.
+ initial_url = None if mode in {None, "pr"} else custom_url
+ url = report_url(name, initial_url) if full else None
+ files = render_files(release, selected, score, scan, branch, name, full, url, existing=existing)
+ files = bind_caller_approval(repo, files)
+ # A private site's actual URL is discovered in PR mode. Do not compare
+ # its existing publisher with a provisional public URL first.
+ changed = check_files(repo, files, expected) if mode in {"preview", "save"} else list(files)
plan = {
"repository": name,
"default_branch": branch,
@@ -714,10 +988,12 @@ def init(
"full": full,
"report_url": url,
"changed_files": changed,
- "scan_blob": blob_id(files[SCAN]),
- "workflow_ref": release["workflow_ref"],
+ "scan_blob": caller_approval(files),
+ "workflow_ref": existing.evaluator_sha if existing else release["workflow_ref"],
"publisher_ref": release["publisher_ref"] if full else None,
- "image": release["image"],
+ "image": existing.data["jobs"][existing.job]["with"].get("image") if existing else release["image"],
+ "scan_workflow": existing.uses if existing else f"{workflow_helpers.EVALUATOR}@{release['workflow_ref']}",
+ "component": existing.delegated_wrapper if existing else None,
"completed_steps": [],
}
summary = Table.grid(padding=(0, 2))
@@ -725,44 +1001,74 @@ def init(
summary.add_row("Quality gate", f"{score}/100")
summary.add_row("PR checks", "Changed skills" if scan == "auto" else "All selected skills")
if full:
- summary.add_row("Feedback", "Public HTML + updated PR comment")
- summary.add_row("Setup", "2 workflow files + GitHub Pages")
+ summary.add_row("Feedback", "Hosted HTML + updated PR comment")
+ summary.add_row("Setup", "Keep scan + add publisher" if existing else "2 workflow files + GitHub Pages")
+ if existing and existing.delegated_wrapper:
+ summary.add_row("Version policy", "Trust the approved component to choose evaluator versions")
else:
summary.add_row("Feedback", "Check + downloadable HTML")
summary.add_row("Setup", "1 workflow file")
question(
5, "Ready to set up?", summary, "pr = set up GitHub + open PR | preview = no changes | save = files only"
)
- if show_files:
- for path, content in files.items():
- console.print(f"\n{path}\n{content}", markup=False)
if not changed:
console.print("Workflow files already match.")
if mode is None:
mode = click.prompt("Next", default="pr", type=click.Choice(["preview", "save", "pr"]))
plan["requested_action"] = mode
+ if mode in {"preview", "save"}:
+ if full:
+ report_url(name, custom_url)
+ changed = check_files(repo, files, expected)
+ plan["changed_files"] = changed
if mode == "preview":
plan["action"] = "preview"
- console.print("No changes applied. Preview needs no login.")
+ console.print("No changes applied. Preview needs no login; PR mode verifies access and report visibility.")
elif mode == "save":
if not no_input and changed and not click.confirm("Save these workflow files locally?", default=False):
plan["action"] = "cancelled"
console.print("Cancelled. No changes applied.")
else:
- save_files(repo, files)
+ save_files(repo, files, expected)
plan["action"] = "saved" if changed else "unchanged"
console.print("Files saved. Remote settings were not changed. Use PR mode for automatic GitHub setup.")
- elif not no_input and not click.confirm("Configure GitHub and open the setup PR?", default=False):
- plan["action"] = "cancelled"
- console.print("Cancelled. No changes applied.")
else:
+ if not no_input and not click.confirm("Configure GitHub and open the setup PR?", default=False):
+ plan["action"] = "cancelled"
+ console.print("Cancelled. No changes applied.")
+ return
console.print("Checking GitHub access…")
- url_pr = create_setup(repo, name, branch, files, full, plan)
+ state = remote_preflight(repo, name, branch, full)
+ if full:
+ url = report_url(
+ name, custom_url or state["report_url"], verified_private_url=state["verified_private_url"]
+ )
+ files = render_files(
+ release,
+ selected,
+ score,
+ scan,
+ branch,
+ name,
+ full,
+ url,
+ existing=existing,
+ verified_private_url=state["verified_private_url"],
+ )
+ files = bind_caller_approval(repo, files)
+ plan.update(report_url=url, scan_blob=caller_approval(files))
+ console.print("Private report site:" if state["verified_private_url"] else "Public report site:")
+ print_link(url)
+ plan["changed_files"] = check_files(repo, files, expected)
+ url_pr = create_setup(repo, name, branch, files, full, plan, expected=expected)
if url_pr:
plan["pr_url"] = url_pr
show_next_steps(name, full, url_pr, repo=repo)
else:
show_next_steps(name, full, repo=repo)
+ if show_files:
+ for path, content in files.items():
+ console.print(f"\n{path}\n{content}", markup=False, soft_wrap=True)
if output:
output.parent.mkdir(parents=True, exist_ok=True)
with output.open("x", encoding="utf-8") as stream:
@@ -841,7 +1147,8 @@ def demo(repo, no_input):
"GET", f"repos/{name}/contents/{PUBLISH}?ref={quote(branch, safe='')}", missing_ok=True
)
full = publisher_file is not None
- inputs = workflow_inputs(scan_file, "skills")
+ configuration = workflow_helpers.existing_scan(decode_content(scan_file).decode("utf-8"))
+ inputs = configuration.data["jobs"][configuration.job]["with"]
paths = inputs.get("paths")
if not isinstance(paths, str):
raise SetupError("The scan workflow is missing its configured skill paths.")
diff --git a/tests/ci/test_publish_reports.py b/tests/ci/test_publish_reports.py
index 98e4cd6f..af60d456 100644
--- a/tests/ci/test_publish_reports.py
+++ b/tests/ci/test_publish_reports.py
@@ -3,6 +3,8 @@
"""Boundaries for privileged publication of untrusted CI report data."""
+import base64
+import hashlib
import importlib.util
import io
import json
@@ -30,6 +32,8 @@ def trusted_workflow_pins(monkeypatch):
monkeypatch.setattr(verify_provenance, "fetch_signing_keys", lambda: JWKS)
monkeypatch.setenv("TRUSTED_EVALUATOR_SHA", "c" * 40)
monkeypatch.setenv("TRUSTED_CALLER_BLOBS", "b" * 40)
+ monkeypatch.delenv("TRUSTED_WRAPPER_WORKFLOWS", raising=False)
+ monkeypatch.delenv("DELEGATED_EVALUATOR_WRAPPER", raising=False)
def archive(files):
@@ -420,7 +424,7 @@ class FakeAPI:
],
}
if path == "/repos/owner/consumer":
- return {"default_branch": "main"}
+ return {"default_branch": "main", "private": False, "visibility": "public"}
if "/branches/" in path:
return {"commit": {"sha": self.branch_sha}}
if "/pulls/" in path:
@@ -1292,6 +1296,308 @@ def test_wrapper_approval_does_not_bypass_caller_receipt_or_sha_validation(monke
publisher._validate_workflow_provenance(BadAPI(record=record), "owner/consumer", record)
+TAG_WRAPPER = WRAPPER.rsplit("@", 1)[0] + "@v3"
+
+
[email protected]("resolved_sha", ["e" * 40, "f" * 40])
+def test_approved_tag_uses_historical_resolution_and_keeps_leaf_pins(tmp_path, monkeypatch, resolved_sha):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", TAG_WRAPPER)
+ record = run_record()
+ reference = {"path": TAG_WRAPPER, "sha": resolved_sha, "ref": "refs/tags/v3"}
+ record["referenced_workflows"].insert(0, reference)
+ api = NestedAPI(record=record)
+ publisher.publish(
+ api,
+ "owner/consumer",
+ 123,
+ "https://owner.github.io/consumer",
+ tmp_path / "site",
+ tmp_path / "out",
+ render=fake_render,
+ )
+ receipt = json.loads((tmp_path / "site/runs/123/1/receipt.json").read_text())
+ assert receipt["resolved_wrapper_workflows"] == [reference]
+ assert receipt["trusted_evaluator_sha"] == "c" * 40
+ assert "delegated_evaluator_wrapper" not in receipt
+ assert not any("/repos/example/" in path or "/git/ref" in path for path in api.paths)
+ monkeypatch.setenv("TRUSTED_EVALUATOR_SHA", "d" * 40)
+ with pytest.raises(publisher.PublicationError, match="unapproved"):
+ publisher._validate_workflow_provenance(api, "owner/consumer", record)
+
+
[email protected]("ref", [None, "", "refs/heads/v3", "refs/tags/v4", "v3", 1])
+def test_stable_wrapper_requires_exact_historical_tag_identity(monkeypatch, ref):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", TAG_WRAPPER)
+ record = run_record()
+ record["referenced_workflows"].append({"path": TAG_WRAPPER, "sha": "e" * 40, "ref": ref})
+ with pytest.raises(publisher.PublicationError, match="historical GitHub tag"):
+ publisher._validate_workflow_provenance(NestedAPI(record=record), "owner/consumer", record)
+
+
+def caller_contents(source):
+ raw = source.encode("utf-8")
+ return {
+ "type": "file",
+ "path": publisher.WORKFLOW_PATH,
+ "encoding": "base64",
+ "sha": hashlib.sha1(b"blob " + str(len(raw)).encode("ascii") + b"\0" + raw).hexdigest(),
+ "content": base64.b64encode(raw).decode("ascii"),
+ }
+
+
+class DelegatedAPI(FakeAPI):
+ def __init__(self, *, delegate=TAG_WRAPPER, caller=None, leaf_sha="d" * 40, event="push", reverse=False):
+ self.delegate = delegate
+ self.caller = caller_contents(caller or f"name: Skill checks\non: push\njobs:\n scan:\n uses: {delegate}\n")
+ self.leaf_sha = leaf_sha
+ self.leaf = EVALUATOR.rsplit("@", 1)[0] + "@" + leaf_sha
+ wrapper = {"path": delegate, "sha": "e" * 40}
+ if delegate == TAG_WRAPPER:
+ wrapper["ref"] = "refs/tags/v3"
+ references = [wrapper, {"path": self.leaf, "sha": leaf_sha}]
+ record = {**run_record(), "event": event, "referenced_workflows": references[::-1] if reverse else references}
+ super().__init__(record=record)
+
+ def get(self, path):
+ # This token cannot read the private components repository or resolve tags.
+ assert path.startswith("/repos/owner/consumer/") or path == "/repos/owner/consumer"
+ assert "/git/ref" not in path
+ if "/contents/" in path:
+ self.paths.append(path)
+ expected = "d" * 40 if self.record["event"] == "pull_request" else self.record["head_sha"]
+ assert path.endswith("?ref=" + expected)
+ return self.caller
+ return super().get(path)
+
+ def download_artifact(self, artifact_id):
+ if artifact_id == 457:
+ return signed_receipt(self.record, job_workflow_ref=self.leaf, job_workflow_sha=self.leaf_sha)
+ return super().download_artifact(artifact_id)
+
+
+def approve_delegation(monkeypatch, api):
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", api.delegate)
+ monkeypatch.setenv("DELEGATED_EVALUATOR_WRAPPER", api.delegate)
+ monkeypatch.setenv("TRUSTED_CALLER_BLOBS", api.caller["sha"])
+
+
[email protected]("event", ["push", "pull_request", "workflow_dispatch"])
[email protected]("delegate", [TAG_WRAPPER, WRAPPER])
[email protected]("reverse", [False, True])
+def test_explicit_delegation_publishes_new_pinned_leaf_from_private_wrapper(
+ tmp_path, monkeypatch, event, delegate, reverse
+):
+ api = DelegatedAPI(delegate=delegate, event=event, reverse=reverse)
+ approve_delegation(monkeypatch, api)
+ monkeypatch.delenv("TRUSTED_EVALUATOR_SHA")
+ publisher.publish(
+ api,
+ "owner/consumer",
+ 123,
+ "https://owner.github.io/consumer",
+ tmp_path / "site",
+ tmp_path / "out",
+ render=fake_render,
+ )
+ receipt = json.loads((tmp_path / "site/runs/123/1/receipt.json").read_text())
+ assert receipt["trusted_evaluator_sha"] == "d" * 40
+ assert receipt["delegated_evaluator_wrapper"] == delegate
+ assert receipt["trusted_wrapper_workflows"] == [delegate]
+ if delegate == TAG_WRAPPER:
+ assert receipt["resolved_wrapper_workflows"] == [{"path": delegate, "sha": "e" * 40, "ref": "refs/tags/v3"}]
+
+
+ "failure",
+ [
+ "unapproved_delegate",
+ "no_wrapper",
+ "extra_wrapper",
+ "two_leaves",
+ "mutable_leaf",
+ "other_evaluator",
+ "missing_wrapper_ref",
+ "wrong_caller_blob",
+ "invalid_pin_allowlist",
+ "wrapper_signed_receipt",
+ "wrong_leaf_sha",
+ ],
+)
+def test_delegation_rejects_unproven_chains_and_preserves_signed_identity(monkeypatch, failure):
+ api = DelegatedAPI(event="pull_request")
+ approve_delegation(monkeypatch, api)
+ refs = api.record["referenced_workflows"]
+ if failure == "unapproved_delegate":
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", WRAPPER)
+ elif failure == "no_wrapper":
+ refs.pop(0)
+ elif failure == "extra_wrapper":
+ monkeypatch.setenv("TRUSTED_WRAPPER_WORKFLOWS", TAG_WRAPPER + "," + SECOND_WRAPPER)
+ refs.append({"path": SECOND_WRAPPER, "sha": "f" * 40})
+ elif failure == "two_leaves":
+ refs.append({"path": EVALUATOR, "sha": "c" * 40})
+ elif failure == "mutable_leaf":
+ refs[1]["path"] = api.leaf.rsplit("@", 1)[0] + "@v3"
+ elif failure == "other_evaluator":
+ refs[1]["path"] = api.leaf.replace("NVIDIA/SkillEvaluator", "attacker/SkillEvaluator")
+ elif failure == "missing_wrapper_ref":
+ refs[0].pop("ref")
+ elif failure == "wrong_caller_blob":
+ monkeypatch.setenv("TRUSTED_CALLER_BLOBS", "b" * 40)
+ elif failure == "invalid_pin_allowlist":
+ monkeypatch.setenv("TRUSTED_EVALUATOR_SHA", "main")
+ elif failure == "wrapper_signed_receipt":
+ api.leaf, api.leaf_sha = TAG_WRAPPER, "e" * 40
+ elif failure == "wrong_leaf_sha":
+ api.leaf_sha = "f" * 40
+ with pytest.raises(publisher.PublicationError):
+ publisher._validate_workflow_provenance(api, "owner/consumer", api.record)
+
+
+ "caller",
+ [
+ "jobs: {}",
+ "[]",
+ "jobs: []",
+ "jobs:\n scan: []",
+ "jobs:\n scan: {runs-on: ubuntu-latest}",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\n second:\n uses: {EVALUATOR}",
+ f"jobs:\n scan:\n uses: {EVALUATOR}",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\n strategy:\n matrix:\n x: [1, 2]",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\n steps: []",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\n uses: {EVALUATOR}",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\njobs:\n scan:\n uses: {EVALUATOR}",
+ f"job: &scan\n uses: {TAG_WRAPPER}\njobs:\n scan: *scan",
+ f"jobs:\n scan: {{uses: {TAG_WRAPPER}, <<: {{}}}}",
+ f"jobs:\n scan:\n uses: !!str {TAG_WRAPPER}",
+ f"jobs:\n scan:\n uses: {TAG_WRAPPER}\n---\njobs: {{}}",
+ ],
+)
+def test_delegation_rejects_ambiguous_or_nonexclusive_approved_root(monkeypatch, caller):
+ # Even adding an unsafe caller blob to the allowlist cannot relax the delegation shape.
+ api = DelegatedAPI(caller=caller, event="pull_request")
+ approve_delegation(monkeypatch, api)
+ with pytest.raises(publisher.PublicationError):
+ publisher._validate_workflow_provenance(api, "owner/consumer", api.record)
+
+
[email protected]("field, value", [("content", "!!!!"), ("content", "YQ=="), ("encoding", "none")])
+def test_delegation_requires_caller_content_matching_approved_blob(monkeypatch, field, value):
+ api = DelegatedAPI()
+ approve_delegation(monkeypatch, api)
+ api.caller[field] = value
+ with pytest.raises(publisher.PublicationError):
+ publisher._validate_workflow_provenance(api, "owner/consumer", api.record)
+
+
+def test_without_delegation_an_explicit_evaluator_allowlist_remains_required(monkeypatch):
+ monkeypatch.delenv("TRUSTED_EVALUATOR_SHA")
+ with pytest.raises(publisher.PublicationError, match="allowlists"):
+ publisher._validate_workflow_provenance(FakeAPI(), "owner/consumer", run_record())
+
+
+PRIVATE_URL = "https://quiet-project-123.pages.github.io/"
+PRIVATE_PAGES = {"public": False, "build_type": "workflow", "cname": None, "html_url": PRIVATE_URL}
+
+
+class PrivatePagesAPI(FakeAPI):
+ def __init__(self, *, info=None, pages=None):
+ super().__init__()
+ self.info = info if info is not None else {"private": True, "visibility": "private", "default_branch": "main"}
+ self.pages = pages if pages is not None else PRIVATE_PAGES
+
+ def get(self, path):
+ if path == "/repos/owner/consumer":
+ self.paths.append(path)
+ return self.info
+ if path == "/repos/owner/consumer/pages":
+ self.paths.append(path)
+ return self.pages
+ return super().get(path)
+
+
[email protected]("visibility", ["private", "internal"])
[email protected]("trailing_slash", [True, False])
+def test_private_publication_requires_live_private_pages_and_exact_url(tmp_path, visibility, trailing_slash):
+ api = PrivatePagesAPI(info={"private": True, "visibility": visibility, "default_branch": "main"})
+ expected = PRIVATE_URL if trailing_slash else PRIVATE_URL.rstrip("/")
+ published = publisher.publish(
+ api,
+ "owner/consumer",
+ 123,
+ expected,
+ tmp_path / "site",
+ tmp_path / "out",
+ render=fake_render,
+ )
+ assert published["report_url"] == PRIVATE_URL + "runs/123/1/"
+ assert "/repos/owner/consumer/pages" in api.paths
+ assert (tmp_path / "site/runs/123/1/receipt.json").is_file()
+
+
+ "pages, expected",
+ [
+ ({**PRIVATE_PAGES, "public": True}, PRIVATE_URL),
+ ({key: value for key, value in PRIVATE_PAGES.items() if key != "public"}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "public": "false"}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "public": 0}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "html_url": "https://changed.pages.github.io/"}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "html_url": "https://owner.github.io/consumer/"}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "build_type": "legacy"}, PRIVATE_URL),
+ ({**PRIVATE_PAGES, "cname": "reports.example.com"}, PRIVATE_URL),
+ (PRIVATE_PAGES, "https://owner.github.io/consumer/"),
+ (PRIVATE_PAGES, "https://changed.pages.github.io/"),
+ ([], PRIVATE_URL),
+ ],
+)
+def test_private_publication_stops_before_rendering_or_history_writes(tmp_path, pages, expected):
+ site, output = tmp_path / "site", tmp_path / "out"
+ site.mkdir()
+ (site / "history.json").write_text("[]\n")
+ rendered = []
+ with pytest.raises(publisher.PublicationError, match="verified private Pages"):
+ publisher.publish(
+ PrivatePagesAPI(pages=pages),
+ "owner/consumer",
+ 123,
+ expected,
+ site,
+ output,
+ render=lambda *_args: rendered.append(True),
+ )
+ assert not rendered
+ assert (site / "history.json").read_text() == "[]\n"
+ assert sorted(path.name for path in site.iterdir()) == ["history.json"]
+ assert not list(output.iterdir())
+
+
+ "info",
+ [
+ {},
+ {"private": False},
+ {"private": "false", "visibility": "public"},
+ {"private": False, "visibility": "internal"},
+ {"private": False, "visibility": "public"},
+ ],
+)
+def test_private_url_never_bypasses_privacy_recheck_when_repository_metadata_changes(info):
+ with pytest.raises(publisher.PublicationError, match="verified private Pages"):
+ publisher._validate_pages_privacy(
+ PrivatePagesAPI(info=info, pages={**PRIVATE_PAGES, "public": True}),
+ "owner/consumer",
+ PRIVATE_URL,
+ )
+
+
+def test_public_publication_does_not_require_pages_visibility_endpoint():
+ api = FakeAPI()
+ publisher._validate_pages_privacy(api, "owner/consumer", "https://owner.github.io/consumer")
+ assert api.paths == ["/repos/owner/consumer"]
+
+
def test_missing_receipt_is_a_skipped_publisher_run(tmp_path, monkeypatch):
class LegacyAPI(FakeAPI):
def get(self, path):
diff --git a/tests/ci/test_publisher_workflow.py b/tests/ci/test_publisher_workflow.py
index ead8000f..06e24c02 100644
--- a/tests/ci/test_publisher_workflow.py
+++ b/tests/ci/test_publisher_workflow.py
@@ -3,6 +3,7 @@
"""Workflow contracts for attempt-bound publication and queued PR feedback."""
+import json
import os
import re
import shutil
@@ -43,6 +44,17 @@ def test_privileged_preparation_has_pr_read_and_queued_deploy_preserves_feedback
assert "needs.deploy.result == 'success'" in jobs["comment"]["if"]
+def test_wrapper_delegation_is_explicit_and_static_evaluator_pins_remain_available():
+ workflow = load(".github/workflows/publish-skill-reports.yml")
+ inputs = workflow["on"]["workflow_call"]["inputs"]
+ assert inputs["delegated-evaluator-wrapper"]["default"] == ""
+ assert inputs["trusted-evaluator-shas"]["default"] == ""
+ assert inputs["trusted-caller-blobs"]["required"] == "true"
+ step = next(step for step in workflow["jobs"]["prepare"]["steps"] if step.get("id") == "publish")
+ assert step["env"]["DELEGATED_EVALUATOR_WRAPPER"] == "${{ inputs.delegated-evaluator-wrapper }}"
+ assert step["env"]["TRUSTED_EVALUATOR_SHA"] == "${{ inputs.trusted-evaluator-shas }}"
+
+
def test_skipped_stale_run_does_not_deploy_or_upload_feedback():
jobs = load(".github/workflows/publish-skill-reports.yml")["jobs"]
assert jobs["prepare"]["outputs"]["skipped"] == "${{ steps.publish.outputs.skipped }}"
@@ -98,6 +110,72 @@ def test_pages_rejects_invalid_identity_before_requesting_credentials(revision,
assert result.stdout.strip() == "A retained site revision and uploaded Pages artifact are required."
+ "repository, pages, expected, accepted",
+ [
+ ({"private": False, "visibility": "public"}, None, "https://owner.github.io/consumer", True),
+ ({"private": True, "visibility": "private"}, {"public": False}, "https://quiet.pages.github.io/", True),
+ ({"private": True, "visibility": "internal"}, {"public": False}, "https://quiet.pages.github.io", True),
+ ({"private": True, "visibility": "private"}, {"public": True}, "https://quiet.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {}, "https://quiet.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {"public": 0}, "https://quiet.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {"public": "false"}, "https://quiet.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {"public": False}, "https://changed.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {"public": False}, "https://owner.github.io/consumer", False),
+ ({"private": False, "visibility": "public"}, {"public": True}, "https://quiet.pages.github.io/", False),
+ ({"private": False, "visibility": "public"}, {"public": False}, "https://QUIET.pages.github.io/", False),
+ ({"private": True, "visibility": "private"}, {"public": False}, "https://quiet.pages.github.io/\n", False),
+ ({}, {"public": True}, "https://owner.github.io/consumer", False),
+ ],
+)
+def test_deploy_rechecks_private_pages_before_oidc_or_deployment(repository, pages, expected, accepted):
+ node = shutil.which("node")
+ if not node:
+ pytest.skip("Node.js is required to exercise the deployed workflow script")
+ workflow = load(".github/workflows/publish-skill-reports.yml")
+ step = next(step for step in workflow["jobs"]["deploy"]["steps"] if step.get("id") == "deployment")
+ assert step["env"]["PAGES_BASE_URL"] == "${{ inputs.report-base-url }}"
+ assert workflow["jobs"]["prepare"]["permissions"]["pages"] == "read"
+ if pages is not None:
+ pages = {"html_url": "https://quiet.pages.github.io/", "build_type": "workflow", **pages}
+ harness = """
+ const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
+ const [repository, pages] = JSON.parse(process.argv[2]);
+ const calls = [];
+ let credentials = false;
+ const github = {request: async (route, args) => {
+ calls.push(route);
+ if (route === 'GET /repos/{owner}/{repo}') return {data: repository};
+ if (route === 'GET /repos/{owner}/{repo}/pages') return {data: pages};
+ if (route === 'POST /repos/{owner}/{repo}/pages/deployments') {
+ return {data: {id: process.env.SITE_REVISION, page_url: process.env.PAGES_BASE_URL}};
+ }
+ if (route === 'GET /repos/{owner}/{repo}/pages/deployments/{deployment_id}') {
+ return {data: {status: 'succeed'}};
+ }
+ throw new Error('Unexpected request');
+ }};
+ const core = {getIDToken: async () => {credentials = true; return 'test';}, info: () => {}, setOutput: () => {}};
+ new AsyncFunction('github', 'context', 'core', process.argv[1])(github, {repo: {owner:'owner', repo:'consumer'}}, core)
+ .then(() => console.log(JSON.stringify({accepted: true, calls, credentials})))
+ .catch(error => console.log(JSON.stringify({accepted: false, calls, credentials, error: error.message})));
+ """
+ result = subprocess.run(
+ [node, "-e", harness, step["with"]["script"], json.dumps([repository, pages])],
+ env={**os.environ, "SITE_REVISION": "a" * 40, "PAGES_ARTIFACT_ID": "123", "PAGES_BASE_URL": expected},
+ check=True,
+ capture_output=True,
+ text=True,
+ timeout=10,
+ )
+ outcome = json.loads(result.stdout)
+ assert outcome["accepted"] is accepted
+ assert outcome["credentials"] is accepted
+ assert ("POST /repos/{owner}/{repo}/pages/deployments" in outcome["calls"]) is accepted
+ if not accepted:
+ assert "verified private Pages" in outcome["error"]
+
+
def test_privileged_publisher_installs_the_reviewed_hash_locked_bootstrap():
steps = load(".github/workflows/publish-skill-reports.yml")["jobs"]["prepare"]["steps"]
install = next(step for step in steps if step.get("name") == "Install the trusted native report renderer")
diff --git a/tests/test_ci_onboarding.py b/tests/test_ci_onboarding.py
index 89501ce6..bab30507 100644
--- a/tests/test_ci_onboarding.py
+++ b/tests/test_ci_onboarding.py
@@ -528,6 +528,106 @@ def test_bundled_release_and_ci_namespace_are_available():
assert result.exit_code == 0, result.output
+def test_existing_component_onboarding_preserves_team_configuration(repository, release_file):
+ from test_ci_onboarding_existing import CALLER
+
+ scan = CALLER.replace("libraries", "skills").replace(" reference-implementations\n", "")
+ path = repository / wizard.SCAN
+ path.write_text(scan)
+ subprocess.run(["git", "-C", str(repository), "add", wizard.SCAN], check=True)
+ subprocess.run(
+ [
+ "git",
+ "-c",
+ "core.hooksPath=/dev/null",
+ "-c",
+ "commit.gpgsign=false",
+ "-C",
+ str(repository),
+ "commit",
+ "-m",
+ "Existing team configuration",
+ ],
+ check=True,
+ capture_output=True,
+ )
+ result = invoke(repository, release_file, "--no-input", "--mode", "save")
+ assert result.exit_code == 0, result.output
+ original, updated = yaml.safe_load(scan), yaml.safe_load(path.read_text())
+ updated["jobs"]["catalog"]["permissions"].pop("id-token")
+ assert updated == original
+ publisher = yaml.safe_load((repository / wizard.PUBLISH).read_text())
+ inputs = publisher["jobs"]["reports"]["with"]
+ assert inputs["delegated-evaluator-wrapper"].endswith("@v3")
+ assert "trusted-evaluator-shas" not in inputs
+ assert inputs["trusted-caller-blobs"] == wizard.blob_id(path.read_text())
+
+
+def test_private_configured_rerun_uses_verified_site_before_file_comparison(repository, release_file, monkeypatch):
+ private_url = "https://unique-private.pages.github.io/"
+ files = wizard.render_files(
+ RELEASE,
+ ["skills"],
+ 70,
+ "auto",
+ "trunk",
+ "example-org/consumer",
+ url=private_url,
+ verified_private_url=private_url,
+ )
+ wizard.save_files(repository, files)
+ state = {"report_url": private_url, "verified_private_url": private_url}
+ monkeypatch.setattr(wizard, "remote_preflight", lambda *_args: state)
+
+ def already_configured(repo, name, branch, actual_files, full, plan, **kwargs):
+ assert actual_files == files
+ assert plan["changed_files"] == []
+ assert plan["report_url"] == private_url
+
+ monkeypatch.setattr(wizard, "create_setup", already_configured)
+ result = invoke(repository, release_file, "--mode", "pr", "--no-input")
+ assert result.exit_code == 0, result.output
+ assert "Setup is configured" in result.output
+
+
+def test_direct_custom_artifact_is_rejected_before_adding_incompatible_publisher(repository, release_file):
+ files = wizard.render_files(RELEASE, ["skills"], 70, "auto", "trunk", "example-org/consumer", full=False)
+ scan = wizard.workflow_helpers.parse_workflow(files[wizard.SCAN])
+ scan["jobs"]["skills"]["with"]["artifact-name"] = "team-report"
+ (repository / wizard.SCAN).write_text(yaml.safe_dump(scan))
+ result = invoke(repository, release_file, "--mode", "preview", "--no-input")
+ assert result.exit_code != 0
+ assert "artifact-name: skill-evaluator-tier1" in result.output
+ assert not (repository / wizard.PUBLISH).exists()
+
+
+def test_caller_approval_matches_git_line_ending_filters(repository):
+ (repository / ".gitattributes").write_text("*.yml text eol=lf\n")
+ files = wizard.render_files(RELEASE, ["skills"], 70, "auto", "trunk", "example-org/consumer")
+ files[wizard.SCAN] = files[wizard.SCAN].replace("\n", "\r\n")
+ bound = wizard.bind_caller_approval(repository, files)
+ (repository / wizard.SCAN).write_bytes(bound[wizard.SCAN].encode())
+ subprocess.run(["git", "-C", str(repository), "add", wizard.SCAN], check=True, capture_output=True)
+ staged = subprocess.check_output(["git", "-C", str(repository), "rev-parse", ":" + wizard.SCAN], text=True).strip()
+ assert wizard.caller_approval(bound) == staged
+ assert wizard.blob_id(bound[wizard.SCAN]) != staged
+
+
+def test_checks_only_pr_rerun_has_no_empty_commit(repository, release_file, monkeypatch):
+ files = wizard.render_files(RELEASE, ["skills"], 70, "auto", "trunk", "example-org/consumer", full=False)
+ wizard.save_files(repository, files)
+ monkeypatch.setattr(wizard, "remote_preflight", lambda *_args: {})
+
+ def already_configured(repo, name, branch, actual_files, full, plan, **kwargs):
+ assert not full
+ assert actual_files == files
+ assert plan["changed_files"] == []
+
+ monkeypatch.setattr(wizard, "create_setup", already_configured)
+ result = invoke(repository, release_file, "--mode", "pr", "--no-input", "--checks-only")
+ assert result.exit_code == 0, result.output
+
+
def test_default_branch_mismatch_stops_before_fetch(repository, monkeypatch):
info = {"default_branch": "main", "permissions": {"admin": True}, "private": False}
calls, git_calls = _remote_state(monkeypatch, info)
diff --git a/tests/test_ci_onboarding_existing.py b/tests/test_ci_onboarding_existing.py
new file mode 100644
index 00000000..661d720f
--- /dev/null
+++ b/tests/test_ci_onboarding_existing.py
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Existing consumer workflows remain the source of repository-specific policy."""
+
+import pytest
+import yaml
+
+from skillevaluator import _ci_onboarding_workflows as workflows
+from skillevaluator._ci_onboarding_git import SetupError
+
+CALLER = """# Keep the team's scan configuration.
+name: Skill checks
+on:
+ pull_request:
+ paths: [libraries/**]
+ push:
+ branches: [trunk]
+permissions:
+ contents: read
+jobs:
+ catalog:
+ name: Catalog Tier 1 checks
+ permissions:
+ contents: read
+ uses: example/components/.github/workflows/skill-checks.yml@v3
+ with:
+ paths: |
+ libraries
+ reference-implementations
+ min-score: 83
+ scan-mode: all
+ scan-workers: 4
+"""
+
+
+def test_existing_component_is_preserved_except_for_required_job_permission():
+ config = workflows.existing_scan(CALLER)
+ assert config.roots == ["libraries", "reference-implementations"]
+ assert config.score == 83
+ assert config.scan_mode == "all"
+ assert config.job == "catalog"
+ updated = config.with_identity_permission()
+ assert updated.startswith("# Keep the team's scan configuration.")
+ old, new = yaml.safe_load(CALLER), yaml.safe_load(updated)
+ new["jobs"]["catalog"]["permissions"].pop("id-token")
+ assert old == new
+ assert config.delegated_wrapper == "example/components/.github/workflows/skill-checks.yml@v3"
+ assert workflows.existing_scan(updated).with_identity_permission() == updated
+
+
+def test_explicit_job_permissions_override_root_identity_permission():
+ content = CALLER.replace("permissions:\n contents: read", "permissions:\n contents: read\n id-token: write")
+ updated = workflows.existing_scan(content).with_identity_permission()
+ assert yaml.safe_load(updated)["jobs"]["catalog"]["permissions"]["id-token"] == "write"
+
+
+def test_inherited_permission_keeps_exact_existing_bytes():
+ content = CALLER.replace(" permissions:\n contents: read\n", "")
+ content = content.replace("permissions:\n contents: read", "permissions:\n contents: read\n id-token: write")
+ assert workflows.existing_scan(content).with_identity_permission() == content
+
+
[email protected]("ref", ["main", "refs/heads/v3", "${{ inputs.version }}", "v3/unsafe"])
+def test_existing_mutable_branch_or_dynamic_wrapper_is_not_silently_approved(ref):
+ with pytest.raises(SetupError):
+ workflows.existing_scan(CALLER.replace("@v3", "@" + ref))
+
+
[email protected]("extra", [" strategy: {matrix: {test: [a, b]}}\n", " secrets: inherit\n"])
+def test_matrix_or_inherited_secrets_are_not_silently_approved(extra):
+ # An existing secret-passing workflow requires deliberate owner review;
+ # report onboarding must not expand its trust automatically.
+ with pytest.raises(SetupError):
+ workflows.existing_scan(CALLER.replace(" name:", extra + " name:"))
+
+
+def test_duplicate_yaml_keys_are_rejected_instead_of_approving_ambiguous_bytes():
+ with pytest.raises(SetupError):
+ workflows.existing_scan(CALLER.replace(" min-score: 83", " min-score: 83\n min-score: 0"))
+
+
+def test_direct_evaluator_keeps_its_existing_pin_and_inputs():
+ pin = "b" * 40
+ content = CALLER.replace(
+ "example/components/.github/workflows/skill-checks.yml@v3",
+ "NVIDIA/SkillEvaluator/.github/workflows/evaluate-skills.yml@" + pin,
+ )
+ config = workflows.existing_scan(content)
+ assert config.evaluator_sha == pin
+ assert config.delegated_wrapper is None
+
+
+def test_multiple_jobs_require_manual_review():
+ with pytest.raises(SetupError):
+ workflows.existing_scan(CALLER + " other:\n runs-on: ubuntu-latest\n steps: []\n")
+
+
+def test_job_permission_insertion_does_not_drop_other_inherited_permissions():
+ content = CALLER.replace(" permissions:\n contents: read\n", "")
+ content = content.replace("permissions:\n contents: read", "permissions:\n contents: read\n checks: read")
+ updated = workflows.existing_scan(content).with_identity_permission()
+ assert yaml.safe_load(updated)["jobs"]["catalog"]["permissions"] == {
+ "contents": "read",
+ "checks": "read",
+ "id-token": "write",
+ }
diff --git a/tests/test_ci_onboarding_pages.py b/tests/test_ci_onboarding_pages.py
new file mode 100644
index 00000000..3fe2d7c3
--- /dev/null
+++ b/tests/test_ci_onboarding_pages.py
@@ -0,0 +1,347 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+"""Privacy, ownership, and URL boundaries for GitHub Pages onboarding."""
+
+import pytest
+
+from skillevaluator import _ci_onboarding_pages as pages_helpers
+from skillevaluator import ci_onboarding as wizard
+from skillevaluator._ci_onboarding_git import SetupError
+
+NAME = "example-org/private-skills"
+PRIVATE_URL = "https://quiet-forest-123.pages.github.io/"
+
+
+def info():
+ return {"private": True, "visibility": "private", "owner": {"type": "Organization"}, "permissions": {"admin": True}}
+
+
+def pages():
+ return {"public": False, "build_type": "workflow", "cname": None, "html_url": PRIVATE_URL, "status": None}
+
+
[email protected]("visibility", ["private", "internal"])
+def test_private_and_internal_repositories_reuse_verified_site(info, pages, visibility):
+ info["visibility"] = visibility
+ private_url = pages_helpers.private_pages_url(NAME, info, pages)
+ assert private_url == PRIVATE_URL
+ assert pages_helpers.report_url(NAME, verified_private_url=private_url) == PRIVATE_URL
+ assert pages_helpers.report_url(NAME, PRIVATE_URL.rstrip("/"), verified_private_url=private_url) == PRIVATE_URL
+
+
[email protected]("value", [None, True, 0, "false"])
+def test_repository_privacy_must_be_explicit_boolean_false(value):
+ assert pages_helpers.is_nonpublic({"private": value, "visibility": "public"})
+
+
+def test_public_repository_is_recognized_and_default_url_is_preserved():
+ assert not pages_helpers.is_nonpublic({"private": False, "visibility": "public"})
+ assert not pages_helpers.is_nonpublic({"private": False})
+ assert pages_helpers.is_nonpublic({"private": False, "visibility": "internal"})
+ assert pages_helpers.report_url("Example-Org/Skills") == "https://example-org.github.io/Skills/"
+ assert pages_helpers.report_url("Example-Org/Skills", "https://example-org.github.io/Skills") == (
+ "https://example-org.github.io/Skills/"
+ )
+
+
[email protected]("value", [None, True, 0, "false"])
+def test_private_site_requires_exact_false_visibility(info, pages, value):
+ pages["public"] = value
+ with pytest.raises(SetupError, match="select Private visibility and GitHub Actions"):
+ pages_helpers.private_pages_url(NAME, info, pages)
+
+
+def test_missing_site_reports_plan_and_policy_prerequisites(info):
+ with pytest.raises(SetupError) as error:
+ pages_helpers.private_pages_url(NAME, info, None)
+ message = str(error.value)
+ assert "GitHub Enterprise Cloud" in message
+ assert "organization policy" in message
+ assert "--checks-only" in message
+ assert f"https://github.com/{NAME}/settings/pages" in message
+ assert "A public site will not be created" in message
+
+
[email protected]("owner", [{"type": "User"}, {}, None])
+def test_personal_or_unknown_owner_is_not_eligible(info, pages, owner):
+ info["owner"] = owner
+ with pytest.raises(SetupError, match="Personal repositories cannot publish private Pages"):
+ pages_helpers.private_pages_url(NAME, info, pages)
+
+
+def test_organization_site_cannot_use_private_access_control(info, pages):
+ with pytest.raises(SetupError, match="unavailable for an organization site"):
+ pages_helpers.private_pages_url("example-org/Example-Org.github.io", info, pages)
+
+
[email protected]("permissions", [{}, {"admin": False}, {"admin": 1}, None])
+def test_private_setup_requires_verified_admin_permission(info, pages, permissions):
+ info["permissions"] = permissions
+ with pytest.raises(SetupError, match="repository admin access"):
+ pages_helpers.private_pages_url(NAME, info, pages)
+
+
[email protected]("private,visibility", [(False, "internal"), (True, "public"), (1, "private"), (True, None)])
+def test_inconsistent_repository_visibility_fails_closed(info, pages, private, visibility):
+ info.update(private=private, visibility=visibility)
+ with pytest.raises(SetupError, match="did not confirm this repository"):
+ pages_helpers.private_pages_url(NAME, info, pages)
+
+
+ "url",
+ [
+ "https://quiet-forest-123.pages.github.io.attacker.example/",
+ "https://pages.github.io/",
+ "https://.pages.github.io/",
+ "https://-bad.pages.github.io/",
+ "https://bad-.pages.github.io/",
+ "https://bad_name.pages.github.io/",
+ "https://example-org.github.io/private-skills/",
+ "http://quiet-forest-123.pages.github.io/",
+ "https://[email protected]/",
+ "https://quiet-forest-123.pages.github.io:443/",
+ "https://quiet-forest-123.pages.github.io:/",
+ "https://quiet-forest-123.pages.github.io:bad/",
+ "https://quiet-forest-123.pages.github.io/?token=secret",
+ "https://quiet-forest-123.pages.github.io/?",
+ "https://quiet-forest-123.pages.github.io/#",
+ "https://quiet-forest-123.pages.github.io/subpath/",
+ "https://quiet-forest-123.pages.github.io//",
+ "https://quiet-forest-123.pages.github.io/../",
+ "https://quiet-forest-123.pages.github.io/\\host",
+ "https://quiet-forest-123.pages.github.io/\n",
+ " https://quiet-forest-123.pages.github.io/",
+ "https://qu\u0131et.pages.github.io/",
+ "https://[bad/",
+ "",
+ None,
+ ],
+)
+def test_private_url_rejects_ambiguous_or_unsupported_origins(info, pages, url):
+ pages["html_url"] = url
+ with pytest.raises(SetupError, match="report URL"):
+ pages_helpers.private_pages_url(NAME, info, pages)
+
+
[email protected]("url", [PRIVATE_URL, "https://elsewhere.example/"])
+def test_unverified_custom_url_cannot_bind_a_repository_to_a_private_site(url):
+ with pytest.raises(SetupError, match="must match this repository"):
+ pages_helpers.report_url(NAME, url)
+
+
+def test_private_custom_url_must_match_the_exact_verified_site():
+ with pytest.raises(SetupError, match="must match this repository"):
+ pages_helpers.report_url(NAME, "https://another-site.pages.github.io/", verified_private_url=PRIVATE_URL)
+
+
[email protected]("url", ["", "https://example-org.github.io/private-skills//"])
+def test_public_url_rejects_empty_or_repeated_trailing_slashes(url):
+ with pytest.raises(SetupError):
+ pages_helpers.report_url(NAME, url)
+
+
+def test_fresh_private_workflow_site_can_be_adopted_after_no_history_or_deployments(pages):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=[])
+
+
[email protected]("deployments", [None, {}, {"deployments": []}, [{"id": 1}], ""])
+def test_unowned_site_requires_verified_empty_deployments(pages, deployments):
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=deployments)
+
+
[email protected]("status", ["built", "building", "errored", "", False])
+def test_unowned_site_with_any_publication_status_is_not_adopted(pages, status):
+ pages["status"] = status
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=[])
+
+
+def test_missing_status_is_not_evidence_that_site_is_fresh(pages):
+ del pages["status"]
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=[])
+
+
[email protected]("public", [True, None, "false", 0])
+def test_only_private_sites_can_be_adopted(pages, public):
+ pages["public"] = public
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=[])
+
+
+def test_unowned_legacy_site_cannot_be_adopted(pages):
+ pages["build_type"] = "legacy"
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ pages_helpers.check_site(NAME, pages, history_exists=False, deployments=[])
+
+
[email protected]("build_type", ["workflow", "legacy"])
+def test_owned_site_can_reuse_history_and_previous_deployments(pages, build_type):
+ pages.update(build_type=build_type, status="built")
+ pages_helpers.check_site(NAME, pages, history_exists=True, deployments=[{"id": 1}])
+
+
[email protected]("history_exists", [True, False])
[email protected]("changes", [{"cname": "docs.example.com"}, {"build_type": "unknown"}])
+def test_owned_or_empty_site_cannot_override_unsupported_configuration(pages, history_exists, changes):
+ pages.update(changes)
+ with pytest.raises(SetupError, match="outside SkillEvaluator"):
+ pages_helpers.check_site(NAME, pages, history_exists=history_exists, deployments=[])
+
+
+def test_missing_public_site_needs_no_existing_site_adoption():
+ pages_helpers.check_site(NAME, None, history_exists=False)
+
+
+def _remote_preflight(monkeypatch, tmp_path, info, pages, *, history=False, deployments=None, full=True):
+ calls = []
+ info["default_branch"] = "main"
+
+ def api(method, endpoint, payload=None, **kwargs):
+ calls.append((method, endpoint, payload))
+ assert method == "GET", "Remote preflight must never mutate settings"
+ if endpoint == f"repos/{NAME}":
+ return info
+ if endpoint == f"repos/{NAME}/pages":
+ return pages
+ if endpoint == f"repos/{NAME}/actions/permissions":
+ return {"enabled": True, "allowed_actions": "all"}
+ if endpoint == f"repos/{NAME}/deployments?per_page=1":
+ return deployments
+ raise AssertionError(endpoint)
+
+ monkeypatch.setattr(wizard, "github_api", api)
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+ monkeypatch.setattr(wizard.git_helpers, "git", lambda *_args, **_kwargs: "same-sha")
+ monkeypatch.setattr(wizard, "history_preflight", lambda *_: history)
+ return wizard.remote_preflight(tmp_path, NAME, "main", full), calls
+
+
[email protected]("visibility", ["private", "internal"])
+def test_preflight_binds_report_url_to_verified_private_site(monkeypatch, tmp_path, info, pages, visibility):
+ info["visibility"] = visibility
+ state, calls = _remote_preflight(monkeypatch, tmp_path, info, pages, deployments=[])
+ assert state["report_url"] == PRIVATE_URL
+ assert state["verified_private_url"] == PRIVATE_URL
+ assert not state["history_exists"]
+ assert any("/deployments?" in endpoint for _, endpoint, _ in calls)
+
+
+def test_owned_private_site_does_not_require_empty_deployments(monkeypatch, tmp_path, info, pages):
+ pages["status"] = "built"
+ state, calls = _remote_preflight(monkeypatch, tmp_path, info, pages, history=True)
+ assert state["history_exists"]
+ assert all("/deployments?" not in endpoint for _, endpoint, _ in calls)
+
+
+def test_private_adoption_rejects_deployments_from_another_environment(monkeypatch, tmp_path, info, pages):
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ _remote_preflight(monkeypatch, tmp_path, info, pages, deployments=[{"id": 1, "environment": "documentation"}])
+
+
+def test_private_checks_only_never_reads_pages(monkeypatch, tmp_path, info, pages):
+ state, calls = _remote_preflight(monkeypatch, tmp_path, info, pages, full=False)
+ assert state["verified_private_url"] is None
+ assert state["report_url"] is None
+ assert all(not endpoint.endswith("/pages") for _, endpoint, _ in calls)
+
+
[email protected]("visibility", [True, None, "false"])
+def test_preflight_rejects_unverified_visibility_before_git_fetch(monkeypatch, tmp_path, info, pages, visibility):
+ pages["public"] = visibility
+ info["default_branch"] = "main"
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+
+ def api(method, endpoint, payload=None, **kwargs):
+ assert method == "GET"
+ if endpoint == f"repos/{NAME}":
+ return info
+ if endpoint == f"repos/{NAME}/pages":
+ return pages
+ raise AssertionError("Private visibility must be verified before other work")
+
+ def unexpected_git(*_args, **_kwargs):
+ raise AssertionError("Private visibility must be verified before fetching")
+
+ monkeypatch.setattr(wizard, "github_api", api)
+ monkeypatch.setattr(wizard.git_helpers, "git", unexpected_git)
+ with pytest.raises(SetupError, match="has not verified a private Pages site"):
+ wizard.remote_preflight(tmp_path, NAME, "main", True)
+
+
+def _enable_private(monkeypatch, tmp_path, info, pages, *, history=False, readback=None, deployments=None):
+ calls = []
+ events = []
+ state = {
+ "info": info,
+ "pages": dict(pages),
+ "verified_private_url": PRIVATE_URL,
+ "report_url": PRIVATE_URL,
+ "history_exists": history,
+ "actions": {"enabled": True},
+ }
+ provider = dict(pages)
+
+ def api(method, endpoint, payload=None, **kwargs):
+ calls.append((method, endpoint, payload))
+ assert method != "POST", "An existing private site must never be recreated"
+ if method == "PUT" and endpoint.endswith("/pages"):
+ assert history, "Only owned legacy history can switch the publishing source"
+ assert payload == {"build_type": "workflow"}
+ provider["build_type"] = "workflow"
+ return {}
+ assert method == "GET"
+ if endpoint == f"repos/{NAME}/pages":
+ return dict(provider if readback is None else readback)
+ if endpoint == f"repos/{NAME}/deployments?per_page=1":
+ return [] if deployments is None else deployments
+ raise AssertionError(endpoint)
+
+ monkeypatch.setattr(wizard, "github_api", api)
+ monkeypatch.setattr(wizard, "initialize_history", lambda *_: events.append("history"))
+ monkeypatch.setattr(wizard, "ensure_environment", lambda *_: events.append("environment"))
+ progress = []
+ wizard.enable_hosting(tmp_path, NAME, "main", state, progress)
+ return calls, events, progress
+
+
+def test_existing_private_site_is_read_back_without_recreation(monkeypatch, tmp_path, info, pages):
+ calls, events, progress = _enable_private(monkeypatch, tmp_path, info, pages)
+ assert all(method == "GET" for method, _, _ in calls)
+ assert events == ["history", "environment"]
+ assert "Report history branch initialized" in progress
+
+
+def test_owned_legacy_private_site_keeps_history_when_switching_source(monkeypatch, tmp_path, info, pages):
+ pages.update(build_type="legacy", status="built")
+ calls, events, _ = _enable_private(monkeypatch, tmp_path, info, pages, history=True)
+ assert [(method, payload) for method, _, payload in calls if method == "PUT"] == [
+ ("PUT", {"build_type": "workflow"})
+ ]
+ assert events == ["environment"]
+
+
[email protected]("changes", [{"public": True}, {"html_url": "https://different.pages.github.io/"}])
+def test_changed_private_site_stops_before_history_or_environment(monkeypatch, tmp_path, info, pages, changes):
+ with pytest.raises(SetupError):
+ _enable_private(monkeypatch, tmp_path, info, pages, readback={**pages, **changes})
+
+
+def test_private_adoption_rechecks_publication_before_initializing_history(monkeypatch, tmp_path, info, pages):
+ with pytest.raises(SetupError, match="not verified as a fresh empty private site"):
+ _enable_private(monkeypatch, tmp_path, info, pages, deployments=[{"id": 123}])
+
+
+def test_private_missing_site_never_creates_pages_or_enables_actions(monkeypatch, tmp_path, info):
+ state = {"info": info, "pages": None, "history_exists": False, "actions": {"enabled": False}}
+
+ def unexpected_mutation(*_args, **_kwargs):
+ raise AssertionError("No API call is safe before a private Pages site is verified")
+
+ monkeypatch.setattr(wizard, "github_api", unexpected_mutation)
+ with pytest.raises(SetupError, match="has not verified a private Pages site"):
+ wizard.enable_hosting(tmp_path, NAME, "main", state, [])
diff --git a/tests/test_ci_onboarding_windows.py b/tests/test_ci_onboarding_windows.py
new file mode 100644
index 00000000..7ef8b243
--- /dev/null
+++ b/tests/test_ci_onboarding_windows.py
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Native Windows assertions for the path-based workflow update fallback."""
+
+import os
+import stat
+import subprocess
+import sys
+
+import pytest
+
+from skillevaluator import ci_onboarding as wizard
+from test_ci_onboarding import repository as repository # noqa: PLC0414 -- export shared pytest fixture
+
+
[email protected](sys.platform != "win32", reason="Requires the native Windows filesystem fallback")
+def test_native_windows_atomic_save_preserves_crlf_and_mode(repository, monkeypatch):
+ assert os.open not in os.supports_dir_fd
+ assert not hasattr(os, "O_NOFOLLOW")
+ target = repository / wizard.SCAN
+ original = "# Team workflow\r\n"
+ updated = "# Team workflow\r\n# Reporting added\r\n"
+ target.write_bytes(original.encode())
+ original_mode = stat.S_IMODE(target.stat().st_mode)
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+
+ wizard.save_files(repository, {wizard.SCAN: updated, wizard.PUBLISH: "# Publisher\r\n"}, {wizard.SCAN: original})
+
+ assert target.read_bytes() == updated.encode()
+ assert (repository / wizard.PUBLISH).read_bytes() == b"# Publisher\r\n"
+ assert stat.S_IMODE(target.stat().st_mode) == original_mode
+ assert not list(target.parent.glob(".skillevaluator-*.tmp"))
+
+
[email protected](sys.platform != "win32", reason="Requires native Windows junction semantics")
+def test_native_windows_workflow_junction_cannot_redirect_writes(repository, monkeypatch, tmp_path):
+ outside = tmp_path / "outside"
+ outside.mkdir()
+ external = outside / "skill-checks.yml"
+ external.write_bytes(b"# External workflow\r\n")
+ workflows = repository / ".github" / "workflows"
+ workflows.rename(repository / ".github" / "original-workflows")
+ result = subprocess.run(
+ ["cmd", "/c", "mklink", "/J", str(workflows), str(outside)], capture_output=True, text=True, check=False
+ )
+ assert result.returncode == 0, result.stderr or result.stdout
+ assert workflows.is_junction()
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+
+ with pytest.raises(wizard.SetupError, match=r"[Ss]ymlink|[Jj]unction|[Rr]eparse"):
+ wizard.save_files(repository, {wizard.SCAN: "# Replacement\r\n"}, {wizard.SCAN: "# External workflow\r\n"})
+
+ assert external.read_bytes() == b"# External workflow\r\n"
+ assert not list(outside.glob(".skillevaluator-*.tmp"))
diff --git a/tests/test_ci_onboarding_writes.py b/tests/test_ci_onboarding_writes.py
new file mode 100644
index 00000000..d8955fb9
--- /dev/null
+++ b/tests/test_ci_onboarding_writes.py
@@ -0,0 +1,169 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Real filesystem checks for atomic workflow updates and safe rollback."""
+
+import os
+import stat
+
+import pytest
+
+from skillevaluator import ci_onboarding as wizard
+from test_ci_onboarding import repository as repository # noqa: PLC0414 -- export shared pytest fixture
+
+OLD = "# Existing team workflow\n"
+NEW = "# Updated team workflow\n"
+
+
+def existing_scan(repository, monkeypatch):
+ target = repository / wizard.SCAN
+ target.write_bytes(OLD.encode())
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+ return target
+
+
+def test_replacement_is_atomic_and_preserves_mode(repository, monkeypatch):
+ target = existing_scan(repository, monkeypatch)
+ target.chmod(0o751)
+ original_mode = stat.S_IMODE(target.stat().st_mode)
+ original_replace = os.replace
+ replacements = []
+
+ def observe_replace(source, destination, **kwargs):
+ assert target.read_text() == OLD
+ replacements.append(destination)
+ return original_replace(source, destination, **kwargs)
+
+ monkeypatch.setattr(wizard.os, "replace", observe_replace)
+ wizard.save_files(repository, {wizard.SCAN: NEW}, {wizard.SCAN: OLD})
+ assert target.read_text() == NEW
+ assert stat.S_IMODE(target.stat().st_mode) == original_mode
+ assert len(replacements) == 1
+ assert not list(target.parent.glob(".skillevaluator-*.tmp"))
+
+
+def test_symlink_after_initial_validation_never_overwrites_referent(repository, monkeypatch, tmp_path):
+ target = existing_scan(repository, monkeypatch)
+ outside = tmp_path / "outside.yml"
+ outside.write_text(OLD)
+
+ def replace_with_symlink(_repo):
+ target.unlink()
+ target.symlink_to(outside)
+
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", replace_with_symlink)
+ with pytest.raises(wizard.SetupError, match="Symlink"):
+ wizard.save_files(repository, {wizard.SCAN: NEW}, {wizard.SCAN: OLD})
+ assert outside.read_text() == OLD
+
+
+def test_last_instant_symlink_replacement_never_writes_through_target(repository, monkeypatch, tmp_path):
+ target = existing_scan(repository, monkeypatch)
+ outside = tmp_path / "outside.yml"
+ outside.write_text(OLD)
+ original_replace = os.replace
+
+ def swap_before_replace(source, destination, **kwargs):
+ target.unlink()
+ target.symlink_to(outside)
+ return original_replace(source, destination, **kwargs)
+
+ monkeypatch.setattr(wizard.os, "replace", swap_before_replace)
+ wizard.save_files(repository, {wizard.SCAN: NEW}, {wizard.SCAN: OLD})
+ assert outside.read_text() == OLD
+ assert not target.is_symlink()
+ assert target.read_text() == NEW
+
+
+def test_deleted_existing_workflow_is_not_recreated(repository, monkeypatch):
+ target = existing_scan(repository, monkeypatch)
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: target.unlink())
+ with pytest.raises(wizard.SetupError, match="disappeared"):
+ wizard.save_files(repository, {wizard.SCAN: NEW}, {wizard.SCAN: OLD})
+ assert not target.exists()
+
+
+def test_concurrent_new_file_is_not_overwritten(repository, monkeypatch):
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+ target = repository / wizard.SCAN
+ original_link = os.link
+
+ def collision(source, destination, **kwargs):
+ target.write_text("# Concurrent workflow\n")
+ return original_link(source, destination, **kwargs)
+
+ monkeypatch.setattr(wizard.os, "link", collision)
+ with pytest.raises(FileExistsError):
+ wizard.save_files(repository, {wizard.SCAN: NEW})
+ assert target.read_text() == "# Concurrent workflow\n"
+ assert not list(target.parent.glob(".skillevaluator-*.tmp"))
+
+
+def test_later_write_failure_rolls_back_original_bytes_and_mode(repository, monkeypatch):
+ target = existing_scan(repository, monkeypatch)
+ target.chmod(0o750)
+ original_mode = stat.S_IMODE(target.stat().st_mode)
+
+ def fail_publication(*_args, **_kwargs):
+ raise OSError("Simulated second-file publication failure")
+
+ monkeypatch.setattr(wizard.os, "link", fail_publication)
+ with pytest.raises(OSError, match="second-file"):
+ wizard.save_files(repository, {wizard.SCAN: NEW, wizard.PUBLISH: "publisher\n"}, {wizard.SCAN: OLD})
+ assert target.read_text() == OLD
+ assert stat.S_IMODE(target.stat().st_mode) == original_mode
+ assert not (repository / wizard.PUBLISH).exists()
+ assert not list(target.parent.glob(".skillevaluator-*.tmp"))
+
+
[email protected]("had_original", [True, False])
+def test_rollback_leaves_concurrently_replaced_target_untouched(repository, monkeypatch, tmp_path, had_original):
+ target = existing_scan(repository, monkeypatch) if had_original else repository / wizard.SCAN
+ monkeypatch.setattr(wizard.git_helpers, "require_clean", lambda *_: None)
+ outside = tmp_path / "outside.yml"
+ outside.write_text("# Concurrent external file\n")
+ original_link = os.link
+
+ def fail_after_swap(source, destination, **kwargs):
+ if str(destination).endswith("publish-skill-reports.yml"):
+ target.unlink()
+ target.symlink_to(outside)
+ raise OSError("Simulated later failure")
+ return original_link(source, destination, **kwargs)
+
+ monkeypatch.setattr(wizard.os, "link", fail_after_swap)
+ with pytest.raises(wizard.SetupError, match="Changed targets were left untouched"):
+ wizard.save_files(
+ repository,
+ {wizard.SCAN: NEW, wizard.PUBLISH: "publisher\n"},
+ {wizard.SCAN: OLD} if had_original else None,
+ )
+ assert target.is_symlink()
+ assert outside.read_text() == "# Concurrent external file\n"
+ assert not list(target.parent.glob(".skillevaluator-*.tmp"))
+
+
[email protected](os.open not in os.supports_dir_fd, reason="Directory descriptors are unavailable")
+def test_parent_directory_swap_cannot_redirect_staging_or_write(repository, monkeypatch, tmp_path):
+ target = existing_scan(repository, monkeypatch)
+ outside = tmp_path / "outside"
+ outside.mkdir()
+ (outside / target.name).write_text(OLD)
+ moved = tmp_path / "moved-original-directory"
+ original_open = os.open
+ swapped = False
+
+ def swap_parent(path, flags, *args, **kwargs):
+ nonlocal swapped
+ descriptor = original_open(path, flags, *args, **kwargs)
+ if not swapped and str(path).startswith(".skillevaluator-"):
+ swapped = True
+ target.parent.rename(moved)
+ target.parent.symlink_to(outside, target_is_directory=True)
+ return descriptor
+
+ monkeypatch.setattr(wizard.os, "open", swap_parent)
+ monkeypatch.setattr(wizard.os, "supports_dir_fd", {*os.supports_dir_fd, swap_parent})
+ with pytest.raises(wizard.SetupError, match="Symlink"):
+ wizard.save_files(repository, {wizard.SCAN: NEW}, {wizard.SCAN: OLD})
+ assert (outside / target.name).read_text() == OLD
+ assert (moved / target.name).read_text() == OLD
+ assert not list(moved.glob(".skillevaluator-*.tmp"))
diff --git a/uv.lock b/uv.lock
index 30b9a033..e76c51de 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2556,7 +2556,7 @@ wheels = [
[[package]]
name = "skillevaluator"
-version = "0.7.1"
+version = "0.7.2"
source = { editable = "." }
dependencies = [
{ name = "click" },