Commit Graph

140 Commits

Author SHA1 Message Date
Benoît Cortier 46e1d24a7c ci(pr-automation): retrigger review on opt-in (#1688)
Treat the oversized-review label as an explicit review request so a
maintainer can retry a failed review without waiting for another CI
completion or classification-state change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-18 17:14:50 +09:00
Benoît Cortier 66deb2a260 ci(pr-automation): allow oversized review opt-in (#1680)
Allow maintainers to retain an oversized-review opt-in without using
broad force mode.

Keep every review gate except the size exclusion, and rerun normal
classification and review on later pushes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-17 02:04:47 +09:00
Benoît Cortier 58b85de8ba ci(pr-automation): use Sonnet for reviews (#1666)
Run protocol and skeptical reviews with Sonnet at high effort to reduce
model cost while retaining deliberate analysis.

Document the explicit model and effort configuration so operators can
verify the cost profile.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-15 03:38:56 +09:00
Benoît Cortier 5fa795c238 ci(pr-automation): supply PR context to reviewer (#1657)
Give the skeptical review stage bounded PR descriptions and human
follow-up comments so it can evaluate preparatory changes against their
stated downstream use.

Keep the context tied to the reviewed head and treat it as untrusted
model evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-14 19:34:44 +09:00
Benoît Cortier 346f316afa ci: protect Cargo test settings (#1650)
Reject pull requests that remove `test = false` or `doctest = false`
from Cargo targets so tests remain centralized in the testsuite crates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-13 22:37:25 +09:00
Benoît Cortier ea1af60a10 ci(pr-automation): revise size label thresholds (#1639)
Classify pull requests by the larger changed-line or touched-file
bucket. Add `size/XXL` and reserve split guidance and review exclusion
for it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-12 20:21:20 +09:00
Benoît Cortier ef5fb9be35 ci(agents): source common skills from Gateway (#1613)
Mirror all nine common agent skills from Devolutions Gateway.

Gateway is their canonical source. IronRDP-only skills remain local.

Synchronization depends on Gateway PR #1922 landing first:
https://github.com/Devolutions/devolutions-gateway/pull/1922

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 03:55:04 +09:00
Benoît Cortier e8090c027a ci(pr-automation): bind evidence to PR base (#1612)
Build every LLM evidence bundle from the merge base of the resolved pull
request base and head instead of the current `master` merge base. This
keeps model-visible paths aligned with GitHub's trusted pull request
file list when histories diverge without admitting base-only changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 02:52:49 +09:00
Benoît Cortier 2029948787 ci(pr-automation): preserve legitimacy flags (#1610)
Legitimacy classifications are audit events, but later classifier runs
could delete the explanatory comment and replace the risk state.

Publish SHA-bound records through a persistent audit-comment path, add a
sticky triage label, and block automated review until a maintainer
clears it. Keep duplicate and XL notices on the transient reconciliation
path.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 02:08:56 +09:00
Benoît Cortier a9b8b2a17e ci(pr-automation): avoid rejecting valid prose (#1609)
Model output is schema-bound, never reused as instructions, and escaped
before publication. Remove brittle prompt-injection keyword matching so
legitimate protocol requirements do not invalidate otherwise valid
review output.

Clarify commit conventions so fixes to CI, workflows, and automation use
`ci` rather than `fix`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 01:46:51 +09:00
Benoît Cortier e098163e8a ci(pr-automation): clarify review outcomes (#1608)
Attribute skipped reviews to the gate or contributor history so policy
decisions remain successful without hiding their blocker.

Notice transcript recovery after failed model steps and log bounded
output metadata instead of complete structured payloads.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 01:25:12 +09:00
Benoît Cortier 98a5edec6d ci(pr-automation): validate PR messages (#1607)
Enforce repository title, scope, breaking-change, and footer rules from
the trusted base branch without rerunning code CI for metadata edits.

Keep pull request metadata in the GitHub event file so shell parsing
never interprets its contents.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 00:57:24 +09:00
Benoît Cortier d21b05714f fix(ci): avoid duplicate review findings (#1606)
Publish located findings only as inline comments, while retaining
findings without a valid diff location in the top-level review body.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-10 00:27:29 +09:00
Benoît Cortier 4dac61bbf3 ci: recover failed Claude action output (#1604)
Claude action failures can suppress otherwise usable step outputs.

Recover validated results and resume IDs from its bounded transcript.
Failed steps no longer discard successful output or block retries.
Raise the classifier's initial budget from 8 to 10 turns.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 23:40:54 +09:00
Benoît Cortier 210f1d3c2a chore: refine native MSTSC testing skill (#1603)
Move the native MSTSC testing skill into the repository's .agents
convention so it loads with the other local agent skills.

Replace brittle certificate and trace assumptions with behavior grounded
in
the ActiveX implementation. Clarify credential modes, process targeting,
bounded liveness checks, and safe teardown.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 23:17:40 +09:00
Benoît Cortier 8a001b8bdc ci: isolate PR automation concurrency (#1602)
Group CI completion runs by their source commit so stale results cannot
cancel automation for a newer pull request head. Report interrupted
model calls as cancelled instead of treating missing output as
malformed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 23:01:29 +09:00
Benoît Cortier a325b33d7f chore(skills): improve Copilot reviews (#1601)
Rename the review orchestrator to the code-review entrypoint so GitHub
Copilot code review is more likely to load it automatically.

Use Microsoft Learn MCP as the protocol specification fallback when the
local windows-protocols skill is unavailable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 22:54:32 +09:00
Benoît Cortier 7679057576 ci: add forced PR automation (#1596)
Replace the manual CI-only bypass with a workflow_dispatch force
mode. Forced classifier and reviewer runs bypass policy, quota, cache,
and eligibility gates while keeping head, output, protocol, and
stale-write validation intact.

Keep automatic routes unchanged. Forced classifications no longer start
reviews, and forced same-head reviews use run-specific publication
markers so distinct requests publish without duplicating reruns.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 22:03:08 +09:00
Benoît Cortier c0ce24c49a docs: clarify pull request automation (#1595)
Document the automated review pipeline, failure recovery, trust
boundaries, labels, and routing so maintainers can operate it
consistently.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 20:31:43 +09:00
Benoît Cortier 698f3e3112 ci: clean malformed action package manifest (#1591)
Prevent Claude Code Action artifacts from breaking the trusted Node
validators that process model output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-09 11:29:59 +09:00
Benoît Cortier 149606a4f3 ci: retry classifier output (#1577)
Resume the classifier's session once when strict output validation
fails.

Classifier output remains unavailable when neither attempt validates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 04:12:43 +09:00
Benoît Cortier 88af2f6b6c ci: preserve labels on cancellation (#1576)
Cancelled workflow runs have no classifier result, not an unknown risk
assessment. Skip state resolution and writes after cancellation while
preserving the fallback for completed classifier failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 04:09:05 +09:00
Benoît Cortier dd689a4122 ci: resume incomplete automated reviews (#1575)
Resume each heavy review session once when its output is missing or
invalid. Validate selected output again before publication.

Report exhausted attempts with a neutral SHA-bound check without
advancing the AI review count. Preserve completed checks when an
ineligible review-route event cannot retrieve PR evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 04:02:13 +09:00
Benoît Cortier 5e3cc47341 ci: extract labeler prompts (#1573)
Separate workflow-specific input and output contracts from reusable
review methodology. Inject trusted prompt files for each LLM pass and
stage the shared reviewer skills from `.agents/skills`.

The protocol reviewer skill now owns specification discovery and review
methodology, including optional use of `windows-protocols`; the workflow
prompts only describe trusted pipeline inputs and schema-bound outputs.
A regression test enforces this boundary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 03:12:14 +09:00
Benoît Cortier b6104b99b1 fix(ci): use bot token for skill sync PRs (#1571) 2026-08-08 02:03:16 +09:00
Benoît Cortier 43d5b3fb8a ci: add shared skills synchronization (#1567)
Shared skills need a repeatable way to stay aligned with their upstream
repositories without creating unnecessary pull requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 01:08:06 +09:00
Benoît Cortier b911eabaad ci: harden LLM output validation (#1565)
A valid classifier result for PR #1564 was discarded because structured
output represented an empty string as the literal text `""`. That left
the PR at `risk/unknown` and hid the concrete validation failure from
maintainers.

This change canonicalizes that exact empty-string artifact in the shared
text normalizer used by classifier, protocol-analysis, and reviewer
outputs. Required prose still fails closed, while optional empty fields
normalize consistently. Classification failures now publish a neutral
SHA-bound `AI classification` check containing the precise validator or
prerequisite reason, without opening the automated review gate.

Regression coverage includes the PR #1564 payload, reviewer and protocol
text behavior, and neutral diagnostic check publication.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-07 23:36:42 +09:00
Benoît Cortier 238898f06e ci: exclude release-plz bot PRs (#1552)
`devolutionsbot` release-plz pull requests are reported as user
accounts, so they could enter PR classification and review automation.
Treat that account as a bot explicitly, alongside standard GitHub bot
identities.

Adds regression coverage for the user-typed release bot and documents
the exclusion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-05 06:18:23 -04:00
Benoît Cortier bccdd87d05 ci: label protocol-related pull requests (#1553)
Protocol-related pull requests are already identified for specialized
review, but that classification is not visible as a durable PR label.

Adds `kind/protocol` as a managed classifier output. It is applied when
`protocol_related` is true and removed after a later classification no
longer finds protocol impact. The label manifest now records the
supplied description, and automation coverage verifies both transitions.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-05 06:18:09 -04:00
Benoît Cortier bbd63b91b1 ci: handle paginated check runs (#1551)
Octokit's pagination plugin normalizes check-run responses into page
arrays, so the PR automation writer crashed while trying to read a
nested `check_runs` property.

Consume the normalized arrays directly and add regression coverage that
verifies multi-page results select the newest matching check run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 16:32:54 +00:00
Benoît Cortier 9dd579e31c ci: preserve deterministic pull request labels (#1550)
Recent PR automation runs calculated deterministic labels correctly but
discarded their structured output, leaving PRs with only
`maintainer-required` and `risk/unknown`. `actions/github-script` owns
its `result` output and overwrote the workflow's custom value.

Use distinct structured output names for deterministic analysis, quota,
semver, and contributor history so the normalized state receives every
signal. Regression coverage verifies that all deterministic labels exist
in the bootstrap catalog and that a small `.github/**` change receives
`scope/tooling` and `size/XS`.

**Validation:** `node --test .github/pr-automation/automation.test.js`

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 12:16:44 -04:00
Benoît Cortier f973ee2613 ci: fix Claude structured output schemas (#1549)
Claude rejects structured-output tool schemas that use a top-level
`allOf`, which prevented PR classification from running. Remove those
top-level conditional constraints from the classifier and both reviewer
schemas; the existing runtime validators continue to enforce the same
cross-field invariants.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 12:03:54 -04:00
Benoît Cortier 7faa924257 ci: allow semver job to access Rust toolchain (#1548)
Fix the isolated `cargo-semver-checks` invocation running as `nobody` by
resolving the active Rust toolchain, granting traversal only through the
required rustup parent directories, and granting read/execute access
only to that toolchain. The untrusted checkout and isolated Cargo state
remain owned by `nobody`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 12:03:44 -04:00
Benoît Cortier 80ade4ee62 ci: streamline pull request labels (#1547) 2026-08-05 00:41:37 +09:00
Marc-André Moreau c31e43f755 Add ActiveX RPC backend for ironrdp-agent (#1544)
## Summary
- add the opt-in ActiveX local-RPC listener and message-window command
dispatch
- add `ironrdp-agent --backend active-x` selection and process-local
ActiveX guidance
- support native MSTSC/RDP-file launch flows with strict
`RDP_AUTOLOGON=1` credentials and preserve Kerberos/KDC configuration

## Validation
- `cargo fmt --check`
- `cargo clippy -p ironrdp-agent -p ironrdp-activex --all-targets -- -D
warnings`
- `cargo test -p ironrdp-agent --lib`
- `cargo test -p ironrdp-activex --lib`
- `cargo test -p ironrdp-rpc`

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 11:14:10 -04:00
Benoît Cortier 04aa0acc1e ci: isolate semver labeler workspace (#1546)
Fixes the pull_request_target semver gate by using an isolated
runner-temp workspace and direct Rust toolchain binaries for the
unprivileged
obody process. This avoids the runner-owned working-directory and Rustup
permission failures in the labeler workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 14:01:22 +00:00
Benoît Cortier 4ff10f37a5 ci: fail closed when semver checks cannot run (#1532)
`cargo-semver-checks` could be unavailable while the public API
compatibility job still passed, hiding real API breaks such as PR #1530.

Install the checked binary in a run-scoped directory accessible to the
unprivileged analysis user, and make setup or any unexpected semver exit
status fail the job. Only cargo-semver-checks' documented results remain
accepted: `0` for compatible and `100` for an incompatibility.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 12:01:59 +00:00
Benoît Cortier 00dd7588a9 ci: log classifier failure diagnostics (#1542)
The classifier can fail before producing structured output while the
Claude action suppresses the underlying provider error. This makes
recurring failures indistinguishable from malformed model output.

Adds a failure-only diagnostic after the classifier action that reads
its preserved execution result and logs bounded, redacted result
metadata and provider error strings. Full action output remains
disabled, so prompts, tool calls, and untrusted PR evidence are not
exposed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-04 11:58:54 +00:00
Benoît Cortier e9e0bb4950 ci: sanitize symlinks in untrusted PR checkout to prevent LLM secret exfiltration (#1535)
### Motivation
- Prevent a malicious forked pull request from creating symlinks in the
`pr-head` checkout that could be followed by filesystem-reading LLM
tooling and disclose runner-local secrets such as API keys.

### Description
- Remove all symbolic links in the untrusted checkout by running `find
pr-head -type l -delete` immediately after checking out the head in
`.github/pr-automation/fetch-pr-evidence.sh`.
- Document the symlink-sanitization security boundary in
`.github/PR_AUTOMATION.md` while preserving symlink changes in the
generated diff evidence.

### Testing
- Ran `bash -n .github/pr-automation/fetch-pr-evidence.sh` which
succeeded.
- Ran `git diff --check` which reported no issues.
- Ran `node --test .github/pr-automation/automation.test.js` and all 34
tests passed.
- Executed an automated end-to-end malicious-symlink checkout test that
verified `pr-head/leak` symlink is removed while the change still
appears in `pr-evidence/changed-files.txt`.
- Attempted `cargo xtask check typos -v` but it could not run because
`typos-cli` is not installed in the environment.

------
[Codex
Task](https://chatgpt.com/codex/cloud/tasks/task_b_6a70cce561308329b74fd5dc01e146ec)
2026-08-03 15:40:57 -04:00
Benoît Cortier 54b1a36a45 ci: fix Claude JSON schema compatibility (#1533)
## Summary
- remove the unsupported Draft 2020-12 declaration from AI
structured-output schemas
- let the Claude action SDK use its supported default schema dialect for
classifier, protocol reviewer, and reviewer jobs

## Testing
- `node --test .github/pr-automation/automation.test.js`

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-03 13:36:37 -04:00
Benoît Cortier cc9bae668c ci: log PR automation decisions (#1534)
## Why

Pull request automation spans multiple jobs and was difficult to
diagnose when a label, gate, or LLM stage produced an unexpected result.

## What changed

- Emit structured logs for PR resolution, gates, deterministic analysis,
normalized states, and final write decisions.
- Log the complete schema-bound output and outcome from each LLM stage.
- Record all upstream job outcomes in the final write trace so skipped
routes are visible.
- Document the trace and its untrusted-output handling.

## Notes

LLM output is logged through `core.info`, so untrusted model text is not
interpreted as a GitHub Actions command.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-03 13:36:28 -04:00
Benoît Cortier 417ac7e76a ci: add AI-assisted pull request classification and review (#1531)
Introduce a staged pull request automation pipeline that labels changes,
gates on green CI, and runs protocol-aware and skeptical reviews.

Deterministic analysis assigns size, area, and semver signals. A cheap
classifier (sonnet, low effort) proposes labels, protocol relevance, and
a risk level; heavy reviewers (opus) run only behind an edge-triggered
gate that requires trusted classification state and a green CI run.

Risk encodes required human scrutiny: a cargo-semver-checks
incompatibility forces high, a classifier-only breaking signal keeps its
medium or high judgement and normalizes an incoherent low to medium.
Protocol-related changes are always reviewed regardless of risk; all
other gates still apply.

Reviews of size/XL pull requests are skipped deterministically, with
guidance to split the change using GitHub stacked pull requests. The
guidance is withdrawn once the pull request drops below the threshold.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-03 16:43:15 +00:00
Marc-André Moreau ee58b7c5f2 feat(activex): add IronRDP ActiveX COM server (#1523)
## Summary
- Add the IronRDP ActiveX COM server and native MSTSC host integration.
- Provide bounded native-host diagnostics, credential-bridge support,
and an AxHost test harness.
- Preserve the minimal client, connector, and error integrations needed
by the control.

## Validation
- cargo check -p ironrdp-activex
- Focused ironrdp-error and ironrdp-connector tests
- cargo test -p ironrdp-activex --lib --no-run
- cargo fmt --all -- --check
- cargo xtask check locks -v

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-02 22:11:44 -04:00
Marc-André Moreau ffedb69ca8 Add agentic RDP CLI and localhost CI workflow (#1289)
## Summary

- Add `ironrdp-agent`, a daemon-backed CLI for agentic/headless RDP
automation over local IPC
- Add mouse, keyboard, resize, wait-frame, screenshot, status, sessions,
connect/disconnect commands
- Support `.rdp` files, logging controls, and `--desktop-size WxH`
- Add a push/manual Windows workflow that enables localhost RDP, drives
`ironrdp-agent`, verifies PSRemoting, and uploads screenshot/log
artifacts

## Validation

- `cargo check -p ironrdp-agent`
- `cargo test -p ironrdp-agent`
- `cargo clippy -p ironrdp-agent --all-targets -- -D warnings`
- `cargo xtask check fmt -v`
- `cargo test -p ironrdp-agent --test ipc`
- PowerShell script parse checks
- GitHub Actions Agentic RDP workflow passed on push: run `26121877104`
  - Connected to localhost RDP at `127.0.0.1:3389`
  - Verified `1920x1080` framebuffer
  - Uploaded non-blank screenshot artifact

## Notes

Full workspace `cargo xtask check lints -v` / `cargo xtask check tests
--no-run -v` were blocked locally by the existing Windows `libopus_sys`
CMake generator issue (`Visual Studio 18 2026`), unrelated to the agent
crate path.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-02 12:35:20 -04:00
Benoît Cortier b89828bdd1 ci: clean up pull request labeler workflow (#1494) 2026-07-31 13:57:04 -04:00
Benoît Cortier c3303e9b89 ci: add pull request labeling workflow (#1493) 2026-07-31 22:29:09 +09:00
Vladyslav Nikonov f307203434 ci: pin Swatinem/rust-cache to v2.9.1 for release workflow compliance (#1479)
Updates all `Swatinem/rust-cache` usages from v2.7.3 to v2.9.1 across
CI, fuzz, and release-binaries workflows.
2026-07-28 08:37:39 +00:00
devolutionsbot c0a29813bf chore(release): clean up (#1440) 2026-07-10 16:59:01 +00:00
Benoît Cortier 85443601fb ci: friendly release asset names and drift-free install docs (#1439)
Rename prebuilt binary assets to friendly os-arch names (e.g.
ironrdp-agent-<version>-linux-x64.tar.gz), dropping the Rust target
triple from the filename, and make the triple authoritative by passing
--target to cargo so a runner/target mismatch fails loudly instead of
silently mislabeling an asset.

Move the detailed download/verify instructions out of the READMEs and
into the GitHub Release body, generated by the workflow so they can
never drift from the actual assets. The block is injected idempotently
between sentinel markers, so re-running the workflow (the recovery path
for a failed matrix leg) replaces it in place rather than appending. The
READMEs are demoted to short evergreen pointers to the Releases page.

Extract the duplicated native-dependency install steps (Linux ALSA
headers, Windows NASM) into a shared .github/actions/install-build-deps
composite action reused by ci.yml and release-binaries.yml.
2026-07-10 13:35:19 +00:00
Benoît Cortier 131d7d3dc5 ci(xtask): add dependency-invariant guard for ironrdp-session (#1438) 2026-07-10 09:08:11 -04:00