Commit Graph

205 Commits

Author SHA1 Message Date
Marcus Perryman da4d45a18b Skip unnecessary NASM installation for Windows Arm releases - unused for Arm targets (#2204)
## Summary

Skip the unnecessary NASM installation for native Windows Arm release
builds as its unused and saves around **40.25 seconds / 8.6% on mean job
time** .

Minimum change, two lines (including comment) to gate install only when
on Windows Arm targeting Windows Arm. NASM is an x86/x64 assembler.

## Measured impact 

[24-job
comparison](https://github.com/marcpems/IronRDP-ci-benchmark/actions/runs/39747378333),
using only `windows-11-arm`, pinned upstream `bf5d4a47` (including
#2186), cold isolated caches, and eight observations per variant:

| Variant | Successful agent builds | Mean complete job |
|---|---:|---:|
| With NASM | 8/8 | 469.0 s |
| Without NASM | 8/8 | 428.8 s |
| Without NASM, with a 30-second delay | 8/8 | 452.1 s |

The average reduction was **36 s / 7.8%** with no compilation or
cache-initialization penalty (verified).

[Full methodology, raw measurements, reproducible analysis, and
limitations](https://github.com/marcpems/IronRDP-ci-benchmark/blob/e959d48649bc36c9adb23d92f4b517d6b917135b/benchmarks/nasm-refs-replication/README.md).

## Verification by LLM 

- Run 24 jobs. All 24 caches were independently confirmed through
GitHub's API.
- Omission jobs asserted NASM absence. Every build compiled the same 427
Cargo units/features and used the same native `aws-lc-sys`
aarch64/`clang-cl` configuration.
- Actionlint and 24 OS/architecture/target condition cases passed.
Removing the new condition leaves the workflow semantically identical to
today's upstream workflow; the shared action and its other callers are
untouched.
- The repeated campaign tested the agent. Earlier viewer comparisons
reached identical existing `libopus_sys` linker errors (`__imp_floor`,
`__imp_lrintf`) with and without NASM; this is not a viewer-failure fix.

---------

Co-authored-by: marcpems <20582938+marcpems@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net>
2026-10-22 11:34:51 -04:00
Benoît Cortier baa9a65d6c ci(pr-automation): add conditional specialist reviewers (#2188)
Add five optional specialists to the review pipeline, one per newly
adopted review skill, triggered as the `code-review` skill prescribes:

- `intent-drift` (`intent-drift-audit` and `intent-files`): runs when a
changed path is governed by an intent file on `master` or added by the
PR, following the `intent-files` placement rule.
- `intent-review` (`intent-review`, `intent-files`, and its pitfalls
reference): runs when an `INTENT*.md` or `*.intent*.md` is added or
modified.
- `test` (`test-reviewer`, `test-writer` with its references, and
`test-oracle-reviewer`): runs when a changed, non-removed Rust or C#
file is on a test path, or when its content at the PR's merge base or
head contains a test marker. A marker in the added lines decides without
reading either revision. Markers are matched over the whole text, so
multiline attributes work, and include `#[cfg(...)]` predicates naming
`test` other than as `not(test)`. A predicate scan stops at 4 KiB, and
an unclosed one counts as a marker. A production-only edit in a file
that also holds tests selects `test`; that is the accepted cost of not
locating edits inside tests. An unresolvable merge base, an unfetchable
head, or an unreadable file also selects `test`.
- `dependency` (`dependency-reviewer`, `dependency-pruner`, and the
repo-local `public-dependency`): runs when `Cargo.toml`, `Cargo.lock`,
`package.json`, `package-lock.json`, or a `.csproj` gains lines.
- `rust-style` (`rust-style-reviewer`, `rust-style`, and the trusted
`STYLE.md`): runs when a `.rs` file gains lines.

Deterministic analysis derives these at classification time from the PR
file list and patches, plus `git ls-files` on the trusted `master`
checkout to find intent files. Renamed files match path rules under both
their old and new names. The result is persisted in the existing `AI
classification` check state. The classifier schema and the check-state
version are unchanged, so earlier three-reviewer checks stay valid.
`protocol` and `skeptical` remain the only required reviewers; a failed
optional specialist is disclosed as reduced coverage.

The new canonical order is `protocol`, `skeptical`, `intent-drift`,
`intent-review`, `test`, `dependency`, `code-compressor`, `rust-style`.
Required and correctness reviewers start first when more than three are
selected.

Not added: `contract-review`, because the repository has no
`CONTRACT*.md` yet. It joins with the first contract (one agent JSON,
one prompt, one path rule). `test-oracle-reviewer` is not a separate
specialist because `test` runs it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-21 22:22:24 -04:00
Marc-André Moreau 75ee516f34 ci(agent): make the agentic RDP scenario prove what it rendered (#2189)
## Summary

The manually dispatched **Agentic RDP** workflow passed, but its
screenshot showed Edge's first-run welcome dialog instead of the
requested page. The scenario also hid two weaknesses:

- **Daemon readiness probe never waited.** A failing native command does
not throw in PowerShell, so the `try/catch` loop in
`Start-AgentDaemon.ps1` returned on its first attempt and logged a
`connect to daemon ... os error 2` backtrace. It now checks
`$LASTEXITCODE`, discards the expected stderr, and fails fast if the
daemon process exits.
- **Agent input failures were ignored.** `Invoke-Agent` in the desktop
scenario now throws on a non-zero exit code, matching
`Invoke-AgentRdpdrRegression.ps1`.

The desktop scenario now proves what it rendered:

- Sets the Edge `HideFirstRunExperience` policy for the scenario and
restores the previous value afterwards.
- Opens a solid-color `data:` marker page in a maximized Edge window.
- Polls screenshots for up to 45 s and fails unless the center pixel
matches the marker color.

The PR also bumps `Swatinem/rust-cache` from v2.7.3 to v2.9.1 to match
the other workflows, which removes the Node 20 deprecation warning.

## Verification

- [Run
39642171433](https://github.com/Devolutions/IronRDP/actions/runs/39642171433)
and [run
39647100713](https://github.com/Devolutions/IronRDP/actions/runs/39647100713)
on this branch both passed.
- In both runs, the screenshot shows the blue "IronRDP agentic RDP"
marker page, and the typed command is visible in the address bar.
- The log no longer contains the daemon probe error or the cache
warnings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:26:39 -04:00
Benoît Cortier 00f9704cf8 ci(pr-automation): retry provider error events in streams (#2192)
Specialist reviews kept ending as "provider request failed", leaving
pull requests labeled automation-failed. The provider occasionally
reports a failure as an error event inside an HTTP 200 stream. The
OpenAI SDK raises that as an APIError without a status, which fell
through to the non-retryable default classification, so one transient
provider hiccup discarded the whole reviewer stage.

A status-less APIError is now a transient provider-response failure
retried within the existing request-retry budget, like a malformed
stream. An error event carrying a known quota code stays permanent.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 16:09:04 -04:00
Benoît Cortier d1d8e4fd13 chore(agents): adopt shared Rust style and test skills (#2131)
AGENTS.md now holds only policy that no tool enforces and that an agent
would not find on its own path. The first pass dropped content
discoverable from the tree or covered by a skill or `STYLE.md`: the role
preamble, the generic workflow, file and directory listings, xtask
command lists, the copy of the style rules, and a stale list of crates
missing from `ARCHITECTURE.md`. A review pass then moved rules to where
they trigger. Comment wrapping and test-module placement went to
`rust-style`. The dependency policies went to `public-dependency`. The
`iron-remote-desktop` base-API rule went to nested `AGENTS.md` files
next to its TypeScript and Rust definitions. It dropped rules already
stated by `ARCHITECTURE.md`, `protocol-reviewer`, or root `Cargo.toml`
comments. It also added a pointer to the testsuite crates and a warning
that synced skills are overwritten from Devolutions Gateway. The file
goes from 155 to 35 lines.

`STYLE.md` now extends the sentence-per-line rule to code comments and
doc comments. Devolutions Gateway and picky-rs vendor this file and will
re-sync it.

New skills, mirrored from Devolutions Gateway and added to the weekly
sync list:

- `rust-style`: everyday Rust rules from `STYLE.md`.
- `rust-style-reviewer`: fresh-context style review of changed Rust
lines, now run by `code-review`.
- `test-oracle-reviewer`: checks that a test's expected value is
independent of the code under test.
- `test-pruner`: prunes and strengthens tests with oracle classification
and cargo-mutants evidence.

The sync list also gains the remaining generic Devolutions Gateway
skills. `tdd` and its closure (`grill-intent`, `intent-files`,
`variants`) are dependencies of the synced `test-writer`,
`test-reviewer`, and `test-pruner`. The `contribute` flow brings `lead`,
`orchestrate-effort`, `review-feedback-loop`, `blind-testsuite`,
`contract-review`, `dependency-pruner`, `dependency-reviewer`,
`intent-drift-audit`, and `intent-review`. Intent and skill authoring
brings `agents-md`, `agents-md-review`, `contract-authoring`, and
`skill-discipline`. `code-review` now runs `intent-drift-audit`,
`intent-review`, `contract-review`, `test-reviewer`, and
`dependency-reviewer` when their conditions apply.

Claude Code discovers project skills only under `.claude/skills` and
reads only `CLAUDE.md`, so `.claude/skills` links to `.agents/skills`
and `CLAUDE.md` links sit beside both nested `AGENTS.md` files, as the
root one already does.

`AGENTS.md` now tells agents to start a work session with `/contribute`,
which picks the delivery flow by scale and the skills each step needs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-21 14:47:46 -04:00
Marcus Perryman 579979ead4 Improve Windows Arm release-binaries times by 10% (#2186)
## Summary

Github standard Arm runners have an unconfigured NVMe drive. To improve
build efficiency by 10% this change configures the drive on every run
with an ReFS partition and moves the build to that drive. The intended
benefit is moving build-tree and Cargo-cache I/O from the system volume
to unused local NVMe.

The change only impacts runs that use **`windows-11-arm` job**. 

**On `windows-11-arm`, the measured IronRDP job time (median) improved
by 50s (10.4%) from 481 to 431, including provisioning and cache
overhead.** The compilation time fell from 343 to 326 seconds.

This is a minimal change that touches just the one YML file. An
additional saving is possible by removing NASM install for this runner
as it is not used. I'll prep a separate PR for that.

## Scope and safety

To keep this behaviour durable even if the underlying VM image changes:
- Gate on `runner.os == 'Windows'`, `runner.arch == 'ARM64'`, and
`runner.environment == 'github-hosted'`, to allow the same improvement
if the runner label changes. Also blocks out custom Arm runners to avoid
damaging a custom setup. The step is skipped entirely on Windows x64,
Linux, macOS, and self-hosted runners.
- No-op if `D:` is already assigned. To null the impact if the base VM
image configuration takes this change.
- Initialize only eligible NVMe disk: RAW, zero partitions, online,
writable, non-boot/non-system, at least 50 GiB, and absent from the
partition inventory. Missing or ambiguous storage is a logged no-op.
- Require an ordinary workspace (not a link) and an ordinary Cargo home,
if it exists. Populated workspaces are supported: existing files are
copied before replacing the workspace path with a junction. Never clear
disks, resize partitions, or reformat existing volumes. Operational
errors fail visibly rather than silently continuing after partial
provisioning.
- Use `Format-Volume -DevDrive -FileSystem ReFS` with Windows defaults.
No antivirus exclusions, protection disabling, or filter/trust
overrides.

The workspace and Cargo home move behind junctions to `D:\workspace` and
`D:\cargo-home`; `TEMP`/`TMP` use `D:\build-temp`. `CARGO_HOME`
explicitly names its physical D: path so GNU tar can save and restore
the Rust cache correctly across the workspace junction. The running
Actions agent, `GITHUB_WORKSPACE`, `RUNNER_TEMP`, Rust toolchain, and
hosted tool cache are not reconfigured.

Move any files that might be populated in the workspace by a pre-job.
After copying succeeds the original directory is renamed as a backup and
the original path replaced by the junction.

## Measured wall-clock impact

The comparison below uses the **six `windows-11-arm` cold-cache agent
jobs**
(https://github.com/marcpems/IronRDP-ci-benchmark/actions/runs/39574497666/attempts/1),
with **three fresh jobs per storage variant**, measuring the
empty-workspace path before the populated-workspace extension:

| Runner label | Default median job | ReFS median job | Observed
reduction | Default / ReFS median compile |
|---|---:|---:|---:|---:|
| `windows-11-arm` | 481 s | 431 s | 50 s / 10.4% | 343 s / 326 s |

Job time is `completed_at - started_at`: it includes provisioning,
checkout, dependency installation, caching, compilation, packaging,
artifact upload, benchmark validation, and post-job cleanup. It excludes
queueing.

No timing tests have been done for a populated workspace.

## Verification

- All `windows-11-arm` cold verification jobs passed; all 400 MB Rust
caches were independently verified through GitHub's cache API.
- [Published-release compatibility
run](https://github.com/marcpems/IronRDP-ci-benchmark/actions/runs/39574562225):
both Windows x64 binaries passed with the new step skipped. The Arm
agent passed on both storage variants.
- Revalidated this PR's actual workflow with 22 non-destructive
storage-guard cases, PowerShell parsing, actionlint, and all 12
OS/architecture/hosting combinations.
- Structural YAML comparison: removing the added step reproduces current
upstream's workflow exactly. Empty-workspace relocation retains the
measured fast path; No benchmark tooling or test harness is added to
upstream.
- [Populated-workspace
validation](https://github.com/marcpems/IronRDP-ci-benchmark/actions/runs/39606041636):
both empty and populated workspaces passed on real ReFS volumes using
`windows-11-arm`, including hidden/system and read-only attributes,
nested and empty directories, file symlinks, directory junctions, backup
preservation, and subsequent checkout. Five local cases additionally
covered hidden-only contents, partial-copy failure, and
junction-creation failure; the original data remained available on
failures.

## Evidence and reuse

- [Detailed methodology, caveats, per-job results, cache inventory, and
guard
tests](https://github.com/marcpems/IronRDP-ci-benchmark/tree/baec7cf0a4798d45f35b552290905636c77b6979/benchmarks/refs-storage)
- [Reproducible fork-only benchmark
workflow](https://github.com/marcpems/IronRDP-ci-benchmark/blob/perf/windows-arm-refs-benchmark/.github/workflows/refs-benchmark.yml)

Co-authored-by: marcpems <20582938+marcpems@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 11:42:50 -04:00
irvingouj@Devolutions 8aa19d03ef test: add .NET smoke tests for the FFI bindings (#2158)
The .NET bindings had no runtime test, only a compile check. Upcoming
Diplomat work changes how the generated wrappers hold native handles, so
a regression would only show up in a consumer app.

Add a small console test runner, in the same style as IronVNC's, that
exercises the bindings without a network: image data, byte buffers,
error mapping, PDU sizing, config validation, and the first X.224
exchange of the connector. Run it in the FFI CI job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 17:34:51 -04:00
Benoît Cortier 66bfd60ed3 ci(pr-automation): retry state writes and allow reruns (#2144)
A transient GitHub 500 while adding labels failed the final writer after
a successful classification, losing the whole run. The writer now
installs an Octokit request hook that retries 5xx responses up to three
times with 1, 2, and 4 second delays, but only for requests whose
repetition cannot duplicate state: reads, updates by identity,
deletions, and label additions. Creating comments, reviews, check runs,
and dispatches is never retried, so the review-once and canonical-check
guarantees hold. The github-script `retries` input was not used because
it retries every POST.

Re-running the failed writer job then published nothing and reported
success, leaving the canonical check in progress, because lease
ownership required the exact run attempt that claimed it. The lease
owner is now the workflow run: a later attempt of the same run continues
its lease, and admission in a later attempt may reclaim its own earlier
attempt's lease. GitHub runs attempts of one run sequentially, so other
runs remain excluded while any attempt is active, and a completed run
still releases the lease.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-20 14:28:32 +09:00
Benoît Cortier 1a1f8e6e6f ci(pr-automation): trust review-ready by completed_at (#2152)
GitHub check-run objects have no created_at field, so trustedReady
rejected every AI review-ready check. Reconciliation never selected
needs-review from a review-ready receipt, and repeated commands could
not update the existing check.

Validate the server-assigned completed_at timestamp instead, which every
completed check run carries, and align the test fixtures with the real
API shape.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-20 14:26:20 +09:00
Benoît Cortier fa9665501e feat(xtask): add pinned benchmark corpus (#1942)
Pin public Wireshark RDP captures for repeatable benchmark inputs.

Fetch only immutable raw URLs with curl, verify SHA-256 digests, and
atomically replace corrupt cache entries. CI rejects tracked packet
captures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-20 13:43:12 +09:00
Benoît Cortier 5b0291ff24 ci(pr-automation): retry malformed provider streams (#2143)
Helmcode's glm5.3 endpoint intermittently appends a post-finish delta
that carries a content key, which failed whole classifier and reviewer
stages as non-retryable and caused most recent automation-failed labels.

Every structurally malformed stream, including unparsable
server-sent-event data and rejected post-finish tails, is now a
transient provider failure retried within the existing per-call
request-retry budget, backoff, and stage deadline. Retries resend the
unchanged history and discard the failed attempt, so no tool from a
malformed batch executes. Such tails are still never accepted, and JSON,
schema, and semantic rejections remain output repairs.

Post-finish shapes now distinguish empty or null text keys
(delta-content-empty, delta-reasoning-empty) from carried text. Each
provider attempt records its own structural violation, the completion
log reports the request-retry count and any recovered violation, and
terminal failure logs report only the violation that caused the failure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-20 02:07:21 +09:00
Benoît Cortier daf3c910f1 ci(pr-automation): accept review-ready handoff (#2100)
Let the PR author or a repository writer request human review after a
trusted findings-bearing exact-head AI review, without another model
call or review-count change.

Persist a comment-, review-, and head-bound acknowledgement check so
lifecycle reconciliation preserves the handoff across later events.
Reject stale commands and keep CI, classification, lease, and failure
gates authoritative.
2026-10-10 00:10:56 +09:00
Benoît Cortier 85edbf5363 ci(pr-automation): allow a third automated review (#2097)
Extend the canonical review count to three and preserve the current next
actor after a findings-bearing terminal review.

Bind successful review receipts to the count they produced so a later
classified, green head can hand off to a human without a fourth model
review.
2026-10-08 16:03:47 +09:00
Benoît Cortier 408a08b99c ci(pr-automation): reconcile lifecycle state (#2068)
Derive next-actor labels from current PR, CI, lease, and trusted
exact-head review state instead of individual event transitions.

Preserve already-admitted valid reviews across draft and closed-unmerged
states while stale, merged, ambiguous, and partial states fail closed.
2026-10-08 13:19:40 +09:00
Benoît Cortier bbb15f2e5c ci(pr-automation): update cargo-semver-checks to 0.51.0 (#2088)
The semver job uses the runner's default stable Rust, now 1.99, whose
rustdoc JSON is format v61. cargo-semver-checks 0.49.0 rejects it with
`unsupported rustdoc format v61` (see
https://github.com/Devolutions/IronRDP/actions/runs/37632348831), so the
public API compatibility check fails on every PR. Version 0.50.0 added
v61 support and 0.51.0 is the release matching Rust 1.99.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-07 23:48:28 +09:00
Benoît Cortier 38b074e4be ci(pr-automation): supersede duplicate reviews (#2057)
Claim canonical classification and review checks before provider work,
and recheck automatic review ownership before the general stage. Queued
duplicates exit without evidence or model calls, while abandoned owners
can be reclaimed for an at-least-once retry.

Make same-head canonical success absorbing so later automatic or forced
failures cannot downgrade checks, counts, or actor labels. Partial
publication deliberately remains a manual repair or model-rerun case
rather than introducing a transaction subsystem.
2026-10-01 22:05:19 +09:00
Benoît Cortier 0c5419eca6 ci(pr-automation): let general review repair converge (#2062)
A general review failed after exhausting its repairs because the model
never had the specialist candidate IDs
(https://github.com/Devolutions/IronRDP/actions/runs/36724237360). It
finalized with no dispositions, its one repair lookup hit a rejected
`./` path, and the last repair invented nine IDs from the positional
diagnostic. The published reason kept only the final attempt's counts,
so none of this was visible.

Validators may now return a content-free detail, which replaces the
short reason in repair feedback and is kept per attempt, and repair-only
guidance, which may quote trusted identifiers and is never logged. The
final-review validator uses them to report every coordinate and the
exact `reviewer` and `finding_id` pairs to copy: an entry to add for
absent candidates, and the existing entry to correct when only its
rationale is unusable. This deliberately relaxes the earlier rule that
repair feedback never quotes candidate IDs; they come from the validated
aggregate and are restricted to `^[a-z][a-z0-9-]{0,63}$`.

The general stage also receives the candidate ID index through a new
trusted `prompt-context` input, and each stage's rejected attempts reach
the workflow summary in a new "Rejected output attempts" table. The
openai-agent intent records the prompt context trust rule and the detail
and guidance contract.

The sandbox now drops empty and `.` tool path segments, lists the
allowed capabilities for the workspace root, and truncates lines over
the per-line limit instead of failing the read, which makes an oversized
pull request body readable again. Search results are bounded by the
serialized tool-result budget, so many long matching lines truncate the
result instead of failing the call.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 02:28:58 +09:00
Benoît Cortier 35bc0580bd ci(pr-automation): trust triggering CI run in review gate (#2060)
This PR makes CI completion authoritative during automated review gating and retries lagging workflow-run listings.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 00:22:44 +09:00
Benoît Cortier 31a5066146 ci(pr-automation): expose next review actor (#2054)
Replace the overloaded maintainer-required state with mutually exclusive
needs-review and needs-author-action labels plus an orthogonal
automation-failed marker. Derive the labels from validated exact-head
classification and review outcomes while leaving ordinary blocked routes
outside both queues.

Paginate check and CI lookups, persist the authorizing CI generation,
and revalidate it before non-forced publication. Replace actor labels
removal-first so a failed transition cannot leave contradictory queue
state.
2026-09-30 14:48:54 +09:00
Benoît Cortier cdea64d02b ci(pr-automation): tolerate safe output drift (#2049)
Canonicalize model output through trusted stage-specific normalizers
before applying the unchanged schema and semantic validators. Project
unknown properties and bound only declared non-authoritative prose so
harmless output drift no longer discards valid reviews.

Emit bounded field-specific schema diagnostics for remaining repairable
failures while keeping identity, evidence, locations, provenance, and
publication constraints strict.
2026-09-30 00:12:14 +09:00
Benoît Cortier 3d047cdd04 ci(pr-automation): align tool assembly with SDK (#2045)
Replace truthy tool identity snapshots while appending only function
arguments, matching OpenAI's stream accumulator semantics.

Preserve the stage-derived request timeout and all existing stream,
retry, tail, and preflight safeguards.
2026-09-29 16:22:22 +09:00
Benoît Cortier ef1d497393 ci(pr-automation): accept inert stream tails (#2044)
Ignore only exact empty-delta choices after a terminal response so
compatible providers can append usage metadata without changing content,
reasoning, or tool calls.

Reject every semantic post-finish payload and expose only bounded
counters and static shape diagnostics.
2026-09-29 14:47:08 +09:00
Benoît Cortier 51893c0e1d ci(pr-automation): support Helmcode stream shapes (#2039)
Accept omitted choice indices only for single-choice chunks and one
complete index-less tool call only when it cannot conflict with indexed
fragments.

Reject ambiguous stream shapes before tool execution and expose only the
first parser-owned static violation in diagnostics and failure logs.
2026-09-29 12:53:35 +09:00
Benoît Cortier 8d91a2cc3a ci(pr-automation): bound streamed agent stages (#2037)
Stream Helmcode chat completions beyond the former request cutoff.

Enforce raw-body, idle, and stage budgets within each logical call.
Buffer complete tool batches before execution.
Keep each reviewer stage single-invocation instead of replaying
completed conversations.
Keep jobs alive long enough to persist bounded failures.

Make structured output targets input-only.
Normalize ill-formed Unicode without merging object keys.
Consolidate resolver artifact downloads.
Restore the detailed action trust, repair, and diagnostics intent.
2026-09-29 01:53:33 +09:00
Benoît Cortier e02276ea4b ci(pr-automation): align review output bounds (#2032)
Make schemas and semantic validators share character and integer limits
so valid structured reviews are not rejected by hidden byte budgets.

Retain one assistant-content safeguard and add bounded request
diagnostics for later reliability work.
2026-09-28 20:13:59 +09:00
Benoît Cortier 3e7729ecd9 ci(pr-automation): make every PR eligible immediately (#2029)
Automatic review previously required non-owner/member authors to have
one prior merged pull request before automation would run, posting a
contributor-ineligible comment otherwise. Drop that requirement:
contributorEligibility now returns eligible for any non-bot author
right away, with no merged-PR history lookup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-28 13:56:09 +09:00
Benoît Cortier b149f500b8 ci(agents): sync shared review skills (#1973)
Synchronize portable Tessl linting guidance and the canonical,
self-contained skeptical reviewer from Devolutions Gateway. Use the
canonical agents scope for synchronization PRs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 22:19:50 +09:00
Danny Bédard cd1d484e40 [DEVOPS-4678] chore(ci): drop the Artifactory cache refresh step (#1972) 2026-09-16 15:21:37 -04:00
Benoît Cortier be39881eac ci(pr-automation): hand off after a clean review (#1959)
`maintainer-required` was applied as soon as the second automated review
published, even when that review reported findings. The pull request
then looked ready for a maintainer while the next step still belonged to
the contributor.

The label now follows the review outcome alone: a review reporting no
findings hands the pull request over, and a review reporting findings
withdraws it. Automatic review stops at `ai-reviewed/2`, so
classification performs the handoff on the contributor's next push, once
the outstanding findings are presumed addressed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-12 00:50:54 +09:00
Benoît Cortier 851d956c0f ci(pr-automation): link resolved PR in run summary (#1960)
The run title already names the pull request an automation run targets,
but it is plain text. Getting from a workflow run back to the pull
request means looking the number up by hand, which is annoying when
triaging runs from the Actions tab.

The `resolve-pr` job now writes the link into the run summary as soon as
it resolves a pull request, so it shows up at the top of the run summary
page on every route (classification, CI completion, dispatch, and
review). The URL base comes from a `PULL_REQUEST_URL_BASE` env value
built from `github.server_url` and `github.repository`, matching how
`SUMMARY_URL` is already assembled elsewhere in the workflow. Runs that
resolve no pull request write nothing.

Also documented in `PR_AUTOMATION.md` and the workflow intent file, and
covered by a test that executes the extracted job script and asserts
both the rendered link and the no-PR case.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-12 00:48:36 +09:00
Benoît Cortier 0b7f18d4de ci(pr-automation): show automation mode in the run name (#1958)
The PR automation workflow serves two very different routes,
classification and review, but its run name only carried the pull
request number. In the Actions list every run looked like `PR #123`, so
there was no way to tell a classifier run from a reviewer run without
opening it.

The run name now appends the mode, for example `PR #123 (classify)` or
`PR #123 (review)`.

The mode is derived from the triggering event rather than from
`resolve-pr`'s `route` output, because `run-name` is evaluated before
any job runs and cannot read job outputs. The mapping mirrors `routeFor`
in `.github/pr-automation/resolve-pr.js`:

- `review` for CI `workflow_run`, `repository_dispatch`, and
`workflow_dispatch` with `review: true`
- `classify` for `pull_request_target` and `workflow_dispatch` with
`review: false`

One known imprecision: adding the `ai-review/allow-oversized` label
arrives as a `pull_request_target` event, so it is labeled `classify`.
That is accurate for the route it takes, since it restarts
classification with a larger evidence cap, even though the maintainer's
intent is to reach a review.

The existing run-name test in `.github/pr-automation/automation.test.js`
was extended to cover the new suffix. All 122 tests in that suite pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-12 00:44:16 +09:00
Benoît Cortier 070c56c4dd ci(pr-automation): make overlap detection advisory (#1957)
Metadata-level overlap is not a reason to cancel code review.
The classifier reports possible shared scope through `overlap`, using
bounded candidate titles and truncated bodies without inferring history
or priority.
`triage/overlap` and a neutral advisory comment inform maintainers while
normal review proceeds under the CI, author, rate, evidence, legitimacy,
and review-count gates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-12 00:23:24 +09:00
Benoît Cortier bfc5ecfaa5 ci(pr-automation): clarify review repair failures (#1956)
General-review failures combine vague validation errors with repair
instructions, making it difficult to diagnose rejected output or correct
it within the repair budget.

Derive factual diagnostics in the authoritative final-review validator
and report disposition-map problems together, including missing,
unknown, or duplicate candidates and unusable rationales. Identify
candidates by trusted aggregate positions without echoing model-authored
text, and keep reasons within 230 bytes so runtime telemetry and
terminal errors preserve them intact.

Clarify which specialist findings require dispositions and cover the
repair path through the real runtime with a mock provider. Acceptance
rules, normalization, reviewer budgets, and workflow gates remain
unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-11 13:54:52 +09:00
Benoît Cortier 2c3f6b3793 ci(pr-automation): clarify workflow name and run title (#1950)
Rename the PR automation workflow and intent documentation from
`labeler.*` to `pr-automation.*` to match its actual scope beyond
labeling.

Add an explicit run name that formats the target PR number across
pull_request, workflow_dispatch, repository_dispatch, and workflow_run
triggers, falling back to the source branch and commit SHA when no PR
number is associated.

Update repository documentation and workflow test assertions to match
the new filenames.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-11 11:08:10 +09:00
Benoît Cortier af6feb65ae ci(pr-automation): delay maintainer handoff (#1937)
Reserve maintainer-required for points where maintainer action is next.

Clear stale handoff state during classification and non-green CI, then
restore it after clean or final reviews and when automation stops.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 21:40:31 +09:00
Benoît Cortier b7becead44 ci(pr-automation): reserve turns a repair can spend (#1939)
A semantic rejection lets a repair spend one tool-enabled call on
evidence before it answers, so a repair attempt costs two provider calls
wherever such a repair is possible and one otherwise. The runtime
reserved a single call per attempt, so a long investigation left the
last attempts unreachable: the stage died on the turn ceiling with its
repair budget unspent, reporting an opaque limit rather than what the
model kept getting wrong.

The general reviewer hit exactly this. It produced a review, had it
rejected twice on the same validation error, then exceeded its turn
count with one of its two repairs still unused, so the pull request went
unreviewed while every job reported success.

Reserve the calls a repair can actually spend, withhold the evidence
call when the answer after it would not fit, and raise the general
reviewer's ceiling so its investigation window is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 21:40:13 +09:00
Benoît Cortier 694c006544 ci(pr-automation): classify after final review (#1936)
Keep classification and label reconciliation active after ai-reviewed/2
while preventing another automated review dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 14:27:56 +09:00
Benoît Cortier fd0ddc97c1 ci(pr-automation): explain and preserve repaired output (#1932)
Output repair failures discarded each rejection reason, leaving no
explanation of what the model kept getting wrong. Preserve bounded
diagnostics for empty, oversized, malformed JSON, schema, and semantic
rejections, and include the last rejection in the terminal failure
reason. Review-validator feedback identifies finding positions without
echoing model-provided IDs, titles, or file content.

Disable tools after a repair's evidence lookup so the answering request
carries the configured response format, without an extra provider call
or a change to repair accounting. An immediate answer to a tool-enabled
request remains unconstrained by the provider and must pass local schema
and semantic validation. Provider profiles and repair limits remain
unchanged; strict-output support for the configured model has not been
established.

Give validators the ordered parsed-candidate history so findings and
accepted dispositions added during repair cannot disappear in a later
attempt. Preserve single-baseline caller compatibility and fail closed
if the accumulated findings cannot fit the output schema.

Remove timing races in interrupted-body and header-timeout fixtures, and
measure the stalled-body deadline from before the SDK arms its timer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 13:38:07 +09:00
Benoît Cortier b0a3feb063 ci(pr-automation): harden review pipeline (#1931)
Harden PR-automation classification, review dispatch, and publication
without relaxing SHA-bound safeguards.

- Require a trusted, GitHub Actions-owned `AI classification` check with
valid machine state at the current head before any reviewer starts.
Forced reviews bypass policy and CI eligibility only; valid `Automation
stopped` classifications remain force-reviewable, while missing, stale,
or invalid classifications fail forced or manual `workflow_dispatch`
invocations before provider work begins. Automatic CI and
classification-complete races remain normal skips.
- Retry exactly one malformed, read-only GitHub pull GET (`500
Unexpected end of JSON input`) at the post-check, pre-dispatch boundary
observed in production. Do not retry writes or dispatch POSTs: stale,
terminal, and exhausted paths neither dispatch nor replay the persisted
check. Classification dispatch remains edge-triggered.
- Use four classifier lanes and seven whole-pipeline lanes, with at most
three specialists running per pipeline. The peak provider capacity is 25
concurrent requests: four classifiers plus three specialists across
seven pipelines. Lanes are calculated in trusted JavaScript, not GitHub
Actions expressions.
- Preserve every validated finding, including clean reviews. Required
reviewer failure is unavailable; optional failure produces deterministic
reduced-coverage notices naming unavailable reviewers without provider
diagnostic details.
- Publish stage outcomes and LLM-only metrics with cumulative elapsed
seconds plus explicit input, output, and total token columns. Totals
include repeated context across requests and repairs; missing or partial
usage remains explicit. Detailed failure diagnostics stay in the
workflow summary, not pull-request reviews or checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 13:36:31 +09:00
Benoît Cortier 7ec7bcea0d docs(pr-automation): clarify review pipeline intent (#1928)
Record the review contract after a forced run skipped protocol review
and published despite an optional specialist failure.

Require exact-head classification even in force mode and disclose
reduced coverage while keeping detailed failure reasons in the workflow
summary.
Specify actionable validation diagnostics and LLM-only metrics with
explicit token counts and elapsed seconds.
Allocate four classifier lanes and seven review-pipeline lanes within
the Helmcode key's 25-request limit, retaining whole-pipeline locking
and at most three parallel specialists per pipeline.

Update intent only; workflow implementation is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 10:44:33 +09:00
Benoît Cortier 2a41e52083 ci(pr-automation): recover reviewer stages (#1922)
Recover transient reviewer failures without repeating successful stages.
Retry a stage once after a configurable delay of 120 seconds by default,
using the runtime's retryability verdict and rechecking current
eligibility, head, base, and evidence limits before spending another
request.
Force mode bypasses policy but not evidence or stale-head safeguards;
exhausted output repair remains terminal.

Keep pinned evidence and successful results within one workflow
invocation.
The caller retains publication and the global concurrency lock,
including during the delay; later workflow runs start with a fresh
bounded budget.
Required reviewers remain caller-selected, including an explicit empty
list, with the classification gate as the fallback only when that input
is absent.

Configure up to four request retries and two in-conversation repairs per
reviewer invocation, with trusted review-specific validation.
Return one shared report containing stage outcomes, failed-attempt and
declined-retry reasons, and metrics that preserve unavailable usage and
count both attempts.

Grant the caller the read-only Actions and Checks permissions required
by recovery preflight, so the pipeline can land before its reporting
consumer.
The workflow remains callable only through `workflow_call`, runs at most
three specialists concurrently, and never executes pull request code.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 06:38:31 +09:00
Benoît Cortier de739f3066 ci(pr-automation): report review check diagnostics (#1926)
Expose normalized recovery diagnostics in the AI automated review check
and workflow summary.

Keep failed attempts, unavailable or partial measurements, and the
summary link visible without publishing metrics in review comments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 04:53:37 +09:00
Benoît Cortier 822caaabcf ci(pr-automation): recover agent runtime (#1921)
Keep reusable agent recovery bounded while preserving conversational
repairs, trusted validation, and safe diagnostics.

One SDK request budget covers header, connection, timeout, and
recognized body-disconnect failures. Known transient statuses retry and
credential or access rejection, permanent client errors, and exhausted
quota stop despite provider retry hints; valid `Retry-After` backoff is
honored while per-attempt timeouts remain independent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 04:11:20 +09:00
Benoît Cortier f6983b5d4a ci(pr-automation): report reviewer recovery (#1920)
Invoke one bounded review pipeline that recovers transient failed stages
while retaining successful results.
Configure classifier request retries in its JSON configuration and pass
the required reviewer selection to the pipeline.

Render the shared recovery report in the workflow summary and link it
from the review check, keeping unavailable metrics explicit and
diagnostics out of findings.
Preserve caller-owned eligibility, stale-head and policy safeguards,
idempotent publication, and review-count limits.
Only a report backed by valid final-review output can produce a
successful check.

Depends on #1922.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 03:14:51 +09:00
Benoît Cortier 36912ba34a docs(pr-automation): define review recovery intent (#1915)
Define recovery requirements so provider failures and invalid output do
not waste completed review work.

- Keep request execution and output repair in the reusable action.
- Assign result reuse and review validation to the review pipeline.
- Keep recovery scheduling, publication, and reporting in the labeler.

This change documents intent only; runtime behavior is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-08 11:03:48 +09:00
Benoît Cortier b043d37c2f ci(pr-automation): explain reviewer ineligibility (#1906)
Post a bounded policy comment when contributor history blocks review.

Reuse the marker lifecycle to avoid duplicates and remove stale guidance
after eligibility changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-07 20:31:15 +00:00
Benoît Cortier d4e2157357 ci(pr-automation): explain skipped reviews (#1907)
Publish an Actions job summary when the automated review pipeline is
skipped. List every gate and fork-quota blocker so maintainers can
understand the decision without inspecting raw JSON logs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-08 05:02:57 +09:00
Benoît Cortier 1bec1d57f4 ci(pr-automation): request JSON mode (#1908)
Request the provider's JSON mode for tools-disabled finalization and
repair calls instead of relying on prompt wording alone. This addresses
repeated non-JSON GLM repair responses while preserving the existing
bounded local parse and JSON Schema validation as the acceptance
boundary.

Require the repair turn to correct every reported schema error and
prohibit transport wrappers around its JSON value. Fenced JSON,
schema-invalid JSON, and every other invalid response remain rejected,
and the single bounded repair limit is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-06 18:04:21 -04:00
Benoît Cortier 6897974688 ci(pr-automation): repair empty agent responses (#1905)
Treat null assistant content as an empty validation candidate so the
existing one-shot repair can request corrected JSON. Malformed content
and repair tool calls remain rejected.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-05 05:17:31 +09:00
Benoît Cortier 0afa0bb590 ci(pr-automation): diagnose invalid repairs (#1904)
Preserve the second validation failure in the action failure reason when
the single correction attempt remains invalid.

Use schema paths instead of model-controlled instance paths so the added
diagnostic cannot disclose response property names. Invalid structured
output remains rejected.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-05 02:52:57 +09:00