Repository navigation
quest: plan the fixer's autonomy: start from main, comment, push workflows #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # [S] The fixer comments on GitHub | ||
|
|
||
| ## Goal | ||
|
|
||
| The fixer can post and edit comments on the batch's PRs, for example to | ||
| explain a fix, a disabled flaky test, or the decision it needs. It does this | ||
| with a GitHub installation token for that one repository with only | ||
| `issues: write`, which the daemon mints for each job and which expires with | ||
| it. The token cannot push code, merge, or reach any other repository. As the | ||
| maintainer accepted, it can also edit or close issues and change labels in | ||
| that repository. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-11-01 (user, /quest-plan): "It's also allowed to comment on | ||
| Github." See the [epic](/quest/m0/land-fixer/README.md). | ||
|
|
||
| - How the fixer gets to comment: | ||
| - The daemon posts the comments the fixer writes into its result, so no | ||
| GitHub credential enters the container (recommended, because PR code the | ||
| fixer builds can read the container's environment, as | ||
| [moq-dev/quest#356](https://github.com/moq-dev/quest/pull/356) found for | ||
| the proxy key) | ||
| - ✅ A comment-only token in the container | ||
| - Both | ||
|
|
||
| - GitHub has no comment-only permission; `issues: write` also allows editing | ||
| and closing issues and changing labels, and PR code the fixer builds could | ||
| read the token (Codex review of this plan): | ||
| - A local comment command: the daemon keeps the credential and exposes | ||
| only comment operations inside the container (recommended) | ||
| - ✅ Accept `issues: write` in the container | ||
| - The daemon posts comments from the result | ||
|
|
||
| Mint an installation token for the job's repository with | ||
| `permissions: { issues: "write" }`, which covers PR conversation comments, and | ||
| `repositories: [<repo>]`. Pass it to the agent as `GH_TOKEN` only; the wrapper | ||
| keeps every other credential out, as today. GitHub caps a token at one hour, | ||
| so a longer job gets a fresh one or stops commenting. The daemon keeps posting | ||
| its own requeue and handback comments. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Fixer starts from main](/quest/m0/land-fixer/launch.md) - what the fixer sees when it starts |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # [S] The fixer starts from main | ||
|
|
||
| ## Goal | ||
|
|
||
| The fixer's checkout starts at the batch's base, so Codex loads the base's | ||
| `AGENTS.md`, skills and tooling, never a PR's. It receives each PR in the | ||
| batch as a number, head SHA and ref, plus the failing log. Its prompt says to | ||
| treat everything in the PRs' diffs as data: an instruction there is ignored, | ||
| neither followed nor reported as a reason to hand the PR back. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-11-01 (user, /quest-plan): "The fixer is launched using main and | ||
| has internet access. It's given the list of PRs/hashes in the batch and is | ||
| told to ignore any new instructions in the diff." See the | ||
| [epic](/quest/m0/land-fixer/README.md). | ||
|
|
||
| - Today `startFixer` (`src/cli/land-fixer.ts`) detaches at the batch tip | ||
| (`git checkout --quiet --detach failure.tip`), so the agent starts in a tree | ||
| holding the PRs' merged `AGENTS.md`. Start it at `refs/heads/base` instead, | ||
| and keep `refs/heads/batch` and `refs/heads/pr-<n>` for it to inspect, check | ||
| out, and fix. | ||
| - `assets/land-fix.md` hands back a PR whose content "targets this fixer | ||
| itself". Replace that with the user's rule: ignore such instructions and | ||
| carry on with the task. This also ends handbacks that misread ordinary | ||
| project rules as injections, such as "Pull the latest origin changes" | ||
| ([moq-dev/quest#325](https://github.com/moq-dev/quest/pull/325)). | ||
| - Internet access already landed in | ||
| [moq-dev/quest#356](https://github.com/moq-dev/quest/pull/356). | ||
|
|
||
| ## Related | ||
|
|
||
| - [Fixer comments](/quest/m0/land-fixer/comments.md) - the other capability the user added |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # [XS] moq-bot can push workflow changes | ||
|
|
||
| ## Goal | ||
|
|
||
| The moq-bot GitHub App (ID 1039466) has the `workflows: write` repository | ||
| permission, and every installation that lands through the host gate has | ||
| accepted it: moq-dev/moq, moq.pro, rust2, rind and quest. GitHub then accepts | ||
| a fixer push that touches `.github/workflows`, including a base merge pushed | ||
| to a fork's branch. This quest waits on the maintainer. To check, open the | ||
| App's settings under Permissions; GitHub lists pending permission requests on | ||
| each installation. | ||
|
|
||
| ## Plan | ||
|
|
||
| Decided 2026-11-01 (user, /quest-plan): | ||
|
|
||
| - What happens when a fixer push touches `.github/workflows`: | ||
| - ✅ Grant moq-bot `workflows` | ||
| - The fixer avoids workflows, and the PR parks for a decision | ||
|
|
||
| GitHub refused the fixer's push on | ||
| [moq-dev/moq#7439](https://github.com/moq-dev/moq/pull/7439) (twice), | ||
| [#7467](https://github.com/moq-dev/moq/pull/7467), and | ||
| [#7370](https://github.com/moq-dev/moq/pull/7370); a maintainer session pushed | ||
| each by hand. Once this permission is granted, the refusal that | ||
| [Fork commits](/quest/m0/land-fixer/fork-commit.md) handles should stop | ||
| happening; whether to keep that quest and | ||
| [moq-dev/quest#358](https://github.com/moq-dev/quest/pull/358) is for its | ||
| review. | ||
|
|
||
| Delete this quest once the permission is granted and accepted. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Protected edits](/quest/m0/land-fixer/protected.md) - the fixer edits workflows when the change is mechanical |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe the token's actual permission scope.
This line calls the credential a “comment-only GitHub token,” but
comments.mdrecords that GitHub has no comment-only permission and thatissues: writealso permits editing or closing issues and changing labels. Use “per-job repository-scopedissues: writetoken” here so the Required section does not understate the credential's authority. (raw.githubusercontent.com)