Repository navigation
Simplify separate commands with automatic artifact discovery - #9
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc24c19a-d69e-4ba8-bdd3-6de2e1f8c230
There was a problem hiding this comment.
🔵 Needs a closer look
Hosted Linux cross-job discovery and real-token permission acceptance still lack integration evidence.
2 open issues
What changed in this PR
This PR simplifies separate lint, run, and report jobs by discovering structured artifacts through a shared report identity, without changing native evaluation behavior.
Changes:
- Adds current-run and attempt-scoped discovery with digest and report-identity validation.
- Preserves explicit artifact overrides and supports lint-only reporting without claiming an evaluation pass.
- Documents simpler workflow wiring and adds coverage for discovery, rejection paths, and compatibility.
| File | Description |
|---|---|
| tests/reporter.test.ts | Tests shared-identity lint companions and consistency checks. |
| tests/inputs.test.ts | Tests discovery defaults and paired artifact overrides. |
| tests/example.test.ts | Validates the simplified three-job README workflow. |
| tests/artifacts.test.ts | Covers discovery, pagination, ambiguity, and invalid metadata. |
| tests/action.test.ts | Covers automatic reporting, overrides, and evidence validation. |
| src/reporting.ts | Allows multiple expected report identities. |
| src/reporter.ts | Accepts shared-identity lint companions. |
| src/inputs.ts | Makes primary artifact overrides optional but paired. |
| src/artifacts.ts | Adds artifact naming and scoped discovery. |
| src/action.ts | Integrates discovery, lint fallback, and command validation. |
| README.md | Documents simplified jobs, permissions, identities, and overrides. |
| CONTRIBUTING.md | Defines discovery invariants and synthetic testing boundaries. |
| action.yml | Updates input descriptions for automatic discovery. |
Review effort: Max
| try { | ||
| artifact = await new DefaultArtifactClient().uploadArtifact( | ||
| `evals-${report.reportId}-${process.env.GITHUB_RUN_ATTEMPT ?? '1'}-${directory.slice(-6)}`, | ||
| reportArtifactName(report.reportId, report.command, report.workflowRunAttempt, directory.slice(-6)), |
| | Lint | `lint` | `contents: read` | | ||
| | Evaluate | `run` | `contents: read`, `copilot-requests: write` | | ||
| | Comment | `report` | `contents: read`, `pull-requests: write` | | ||
| | Comment | `report` | `actions: read`, `contents: read`, `pull-requests: write` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Separate lint/run/report jobs currently require artifact IDs and digests to be exported through job outputs, plus two conditional reporting steps. This change lets one
command: reportstep discover matching structured artifacts using a sharedreport-id(defaultevals), without that wiring.Discovery uses the authenticated artifact listing for the current workflow run and attempt, verifies SHA-256 digests and downloaded report identities, and rejects ambiguous, expired, or missing evidence. It reports lint only with a warning when no run artifact exists, never claiming an evaluation pass. Explicit primary ID/digest pairs bypass discovery for backward compatibility; lint-only overrides can accompany a discovered run.
The simplified workflow requires
actions: readon the reporting job. Comment concurrency remains caller-configured and required; execution permissions and native evaluation behavior are unchanged. README examples cover the simplified workflow, custom identities, and explicit overrides. The distribution is rebuilt.Tracking issue: N/A.
Verification
distmatch source.Commands run locally with Node 24 and pnpm 12.8.1:
pnpm exec vitest run tests\inputs.test.ts tests\artifacts.test.ts tests\action.test.ts tests\reporter.test.ts- passed, 104 tests at the focused checkpoint.pnpm build- passed; generateddist/index.cjscommitted.pnpm check- passed, including type checking, lint, 165 model-free tests, coverage thresholds, source-to-bundle comparison, and the clean consumer-directory packaging control.git diff --check- passed.Real native CLI controls use the pinned Vally CLI, built-in mock executor, and deterministic graders. Artifact discovery, digest failures, permissions, pagination, identity rejection, overrides, and comment handling are covered with synthetic GitHub responses; those tests do not establish hosted API/token acceptance. No models were run.
Limitations
Hosted acceptance of automatic artifact discovery and cross-job reporting with
actions: readremains unverified; this PR stays draft pending that integration evidence. The supported Action host remains Linux x64, while local validation was performed on Windows.Discovery does not reuse prior-attempt artifacts: rerun the producing jobs along with reporting. Older Action uploads require explicit IDs/digests. Duplicate matching producers require distinct report identities or explicit artifact selection. This change does not add a reusable reporting workflow or move the concurrency guard inside the Action.