Skip to content

Measure Whether a Copilot Setup Step Can Place Content Where the Reviewer Reads It - #1449

Merged
ptr727 merged 5 commits into
developfrom
feature/copilot-review-env
Sep 8, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/copilot-review-env

Conversation

@ptr727

@ptr727 ptr727 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Temporary measurement for #1321, which asks whether the fleet can put a rule in front of a reviewer
by reaching for it rather than carrying it. GitHub documents
.github/workflows/copilot-code-review.yml as the way to configure the environment a Copilot code
review runs in, and this adds one, with a step that writes a token a review can be asked to report.

This is not permanent content. It lands on develop, is promoted to main because the
mechanism only engages from the default branch, produces one measurement, and is then reverted. The
maintainer authorised that sequence.

What it measures

The token is PROBE-SETUP- plus the run id, which is not derivable from the tree, and it is never
printed, so a review quoting it read a file rather than a log or the workflow that wrote it. It is
written to three destinations, each reporting its own outcome, because GitHub checks the repository
out after setup steps complete and that checkout cleans untracked files. A positive result
therefore also says where a setup step can reach:

Destination Path
Workspace ${GITHUB_WORKSPACE}/.copilot-probe/setup-token.txt
Runner temp ${RUNNER_TEMP}/copilot-probe-setup-token.txt
Home ${HOME}/.copilot-probe-setup-token.txt

The shell block was verified against bash --noprofile --norc -eo pipefail in every state the
review raised: all three destinations present, one unset, one unwritable, one a file where a
directory was expected, symlinked targets, an over-long path, and an empty run id. The three writes
are independent, an unreachable destination reports itself, and an empty run id aborts before
writing a token that would have been derivable.

The runner change beside it

docs/homelab-runner-selection-plan.md prescribed pinning this workflow to ubuntu-24.04 and
adding a step that fails unless runner.environment is github-hosted. Both are removed. A
GitHub-hosted job in this repository runs on ubuntu-latest, which all twenty other runs-on
declarations here already say, and the fleet has no rule restricting which runner a job may accept.
The self-hosted label keeps its own version, since that names a machine rather than selecting a
GitHub-hosted image. The plan's test list no longer asserts a fixed Copilot runner, and it records
that this workflow path is occupied until #1321 is answered.

Review record

Four local adversarial passes ran against this branch, raising 5, 9, 8 and 6 findings. Every
introduced finding is fixed. Two are worth naming because they were real rather than stylistic:
an actions/checkout that would have persisted a repository credential into the workspace an LLM
then reads before writing public comments, and a cat that published the token to a public run
log, which would have let a review quote it without reading anything.

One pre-existing finding is filed as #1448 and blocks nothing: the plan says repository
customization of the Copilot runner type is disabled, then describes the repository setting it.

The final three-line correction was verified by assertion and grep rather than by a fifth pass.

ptr727 and others added 4 commits September 8, 2026 13:11
…up Steps Reach the Reviewer

Issue #1321 rests on whether a hub checkout can be placed in front of the Copilot reviewer without
carrying anything, which is the reach-not-carry question the fleet already answers that way for
tooling. GitHub documents `.github/workflows/copilot-code-review.yml` as the way to configure the
environment a review runs in, with `copilot-setup-steps.yml` as its fallback, and the job id rather
than its name is what the mechanism matches.

The step writes a token keyed to the run id, which is not derivable from the tree, so a review
quoting it read the file rather than the workflow that wrote it. An empty run id would write a
token that is derivable, so the step fails instead of writing one.

This is a measurement rather than a permanent workflow, and it is reverted once the question is
answered.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ter Checkout Cannot Clean It

Review of the first commit raised three defects that each defeat the measurement or the repository.

`actions/checkout` persists a credential into the workspace by default, and this workspace is
handed to a model that then writes public comments, so the step is removed rather than configured.
Nothing here needs repository content, and GitHub checks the repository out after these steps
finish in any case.

That same documented ordering breaks the single-location write: the checkout Copilot runs afterward
cleans untracked files, so a token written only to the workspace is plausibly deleted before a
review reads it. It is now written to the workspace, the runner temp directory, and the home
directory, which also turns a positive result into evidence of where a setup step can reach.

The token was printed to the run log, and this repository is public, so a review could have quoted
it from the log without reading any file, which is the confound the run id was chosen to avoid.
It is no longer printed. The workspace path is added to `.gitignore`, since every review of an
unrelated pull request runs this step while the workflow is on the default branch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…scribing a Pin

Review raised that one fail-fast step made three independent measurements share one fate. An unset
`RUNNER_TEMP` aborted the step under `-u` before the home directory was ever tried, and the probe
then reported "nothing at home", which is the answer it exists to distinguish from "home is
unreadable". Each destination now reports its own outcome and none can end the step. The block
also declares `shell: bash`, since `set -Eeuo pipefail` is bash-only and the shell this environment
runs a setup step under is not established. Verified against `bash --noprofile --norc -eo pipefail`
for all three destinations present, one unset, one unwritable, and an empty run id.

The job dropped `contents: read`, which granted a repository-read token to the setup environment of
every review in this repository while it sits on the default branch, for a job that performs no
checkout and no network read. It now inherits the workflow's empty set.

`docs/homelab-runner-selection-plan.md` prescribed pinning this workflow to `ubuntu-24.04` and
asserting `runner.environment` at runtime. Both came from evaluating self-hosted runners and
neither is kept: a GitHub-hosted job in this fleet runs on `ubuntu-latest`, which all twenty other
`runs-on` declarations here already say, and an assertion cannot make a job safe once GitHub has
assigned it to the wrong runner, so it buys nothing the organization policy does not already give
while costing a rule about which runner a job may accept. The self-hosted label keeps its own
version, since that names a machine rather than selecting a GitHub-hosted image.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…th the Probe Measures

A setup step reads the job's keys rather than the workflow's, so a workflow-level `permissions: {}`
alone left the Copilot path running under whatever the repository default grants. The empty set is
now declared on the job as well, and the workflow-level block stays, since it still governs the
ordinary Actions run and any job added later.

The `.gitignore` entry is removed, because it altered the measurement it was meant to tidy up
after. Nothing local ever creates that directory, since it is written only on a runner, and there
an ignored file and an untracked file are not equivalent: a clean without `-x` keeps the first and
removes the second, and a context gather that enumerates through git does not see the first at all.
Either outcome would make the workspace result unrepresentative of the question being asked, and
the other two destinations sit outside the repository and would not share it.

A `push:` trigger is added so the copy on the default branch is validated by a run of its own
rather than only through a merge ref. It carries the same branch filter as the pull request
trigger, since GitHub's example omits one and a `push:` filtered only by path runs on every branch.

The runner plan keeps the factual correction and drops the reasoning added beside it. That
reasoning claimed the pin and the assertion "were tried", which the same document records as
implementation not started, and claimed the fleet has no rule restricting which runner a job may
accept, which this document's own policy table, selector, trust contract and rollback section each
contradict. Its test list no longer asserts a fixed Copilot runner, and the bullet is dropped
rather than reworded, since the two bullets after it already state what a static test can check
and a live runner assignment is not statically checkable. The plan now records that the workflow
path is occupied by a temporary measurement.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 8, 2026 20:51
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3bfa3bc1-ad85-4b6e-baf9-b2401c803999


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runner plan text remains internally contradictory about whether repo-level Copilot runner customization is disabled, and the new workflow is configured to run as a normal Actions workflow on PR/push when it likely only needs to exist for Copilot consumption.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a temporary GitHub Actions workflow at .github/workflows/copilot-code-review.yml to measure whether Copilot code review setup steps can place non-derivable content where the reviewer can read it, and updates the homelab runner plan to reflect the workflow’s temporary occupancy and the move away from pinning a GitHub-hosted image.

Changes:

  • Add .github/workflows/copilot-code-review.yml with a setup-step job that writes a probe token to multiple locations without printing it.
  • Update docs/homelab-runner-selection-plan.md to switch the GitHub-hosted references from ubuntu-24.04 to ubuntu-latest and adjust the verification checklist accordingly.
File summaries
File Description
docs/homelab-runner-selection-plan.md Updates the runner selection plan language and examples to align with the temporary Copilot workflow and ubuntu-latest.
.github/workflows/copilot-code-review.yml Adds the temporary Copilot setup-step measurement workflow that writes a non-derivable probe token to candidate locations.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/homelab-runner-selection-plan.md Resolved
Review raised that the plan states repository customization of the Copilot runner type is disabled
and then specifies a repository-level `runs-on` for that same workload, which reads as certain about
a precedence the document never established. The sentence now says the two appear to contradict and
points at the issue tracking it, rather than asserting either side.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 8, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are small, self-contained, and the workflow avoids credential checkout and avoids logging the probe token while aligning the docs with the intended temporary measurement.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ptr727
ptr727 merged commit ba86490 into develop Sep 8, 2026
10 checks passed
@ptr727
ptr727 deleted the feature/copilot-review-env branch September 8, 2026 21:37
ptr727 added a commit that referenced this pull request Sep 8, 2026
…nch Can Answer It (#1450)

Promotes one commit, `ba86490`, and nothing else.

The measurement in it only engages from the default branch, which is the
whole reason this
promotion exists rather than waiting for an ordinary release. GitHub
documents that a
`copilot-code-review.yml` is not picked up unless it sits on the default
branch, so the question
#1321 turns on cannot be answered from a feature branch.

## What lands

- `.github/workflows/copilot-code-review.yml`, a setup-steps workflow
that writes a token to three
destinations and reports each outcome separately. It performs no
checkout, holds no token scope,
  and never prints the token.
- `docs/homelab-runner-selection-plan.md`, which no longer prescribes
pinning that workflow to a
fixed image or asserting `runner.environment` at runtime. A
GitHub-hosted job in this repository
runs on `ubuntu-latest`, and the fleet has no rule restricting which
runner a job may accept.

## What this obliges

The workflow is temporary and is reverted once #1321 has its answer.
While it sits here it defines
the setup environment for every Copilot review in this repository, which
is one extra short job per
review. Its own job ran and passed on #1449, so the file is known to
parse and execute.

The revert is recorded in the workflow's own header comment, in the
runner plan at the paragraph
describing that path, and on #1321. It does not depend on anyone
remembering it.

The unresolved question of whether an organization Copilot runner
setting or a repository workflow
wins is tracked in #1448 and is not settled here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants