Skip to content

fix(root): publish validated iyarc-prune pull requests - #10087

Draft
zahin-mohammad wants to merge 5 commits into
masterfrom
codex/WAL-2232-iyarc-prune-create-pr
Draft

zahin-mohammad wants to merge 5 commits into
masterfrom
codex/WAL-2232-iyarc-prune-create-pr

Conversation

@zahin-mohammad

@zahin-mohammad zahin-mohammad commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The weekly dependency-exclusion maintenance job could finish with validated edits but no pull request because the agent treated a checkout on master as a local run. A feature-branch manual dispatch also failed before the agent ran: the AWS role checks the workflow's branch identity, and checking out master does not change that identity. Failure investigation.

Fix

  • The workflow owns signed commits and non-draft pull-request publication; the agent leaves validated edits uncommitted and writes a report outside the repository.
  • Reject non-master dispatches early. Preserve the exact validated parent and file tree instead of letting publication rebase onto a newer master.
  • Check working-tree, staged, and untracked paths. Allow only the exclusion file, root manifests/lockfile, and direct workspace manifests; reject nested test/example manifests and hidden staged source edits.
  • Install the checksum-pinned scanner before the agent runs, and use the release severity gate instead of unsupported scanner flags.

Original defect evidence and verification.

Review map

The readability refactor is d92ae022a1. It retains the previously fixed behavior.

  • Workflow: step order, permissions, environment, and pinned actions. Each operation is a named command, not an embedded shell program.
  • JavaScript helper: dependency-free operations. Start with validateChanges and preparePullRequest for publication policy; writeAgentSummary and requireSuccessfulCompletion handle the agent result. Setup operations handle scanner installation, AWS role credentials, and prompt loading.
  • Permanent regression tests: real isolated Git repositories exercise publication boundaries and failure paths.
  • Agent instructions: validation and handoff contract.

After the agent runs, the workflow reads the helper from the original checkout commit using git show, so modifying the working-copy helper cannot bypass publication checks. No package installation is needed to run the helper. Loader and environment.

Verification

yarn test:scripts
46 passing (20s)

The checked-in tests cover allowed and forbidden paths, hidden staged changes, exact working-tree preservation, changed HEAD, missing reports, duplicate pull requests, GitHub query failures, case-insensitive label preservation, final-result precedence, private metadata filtering, summary-write failure, missing publication URLs, scanner checksum rejection, and modification of the working-copy helper.

node_modules/.bin/prettier --check scripts/iyarc-prune.js scripts/tests/iyarc-prune.test.js .github/workflows/iyarc-prune.yml .claude/agents/iyarc-prune.md
Checking formatting...
All matched files use Prettier code style!
nix shell github:NixOS/nixpkgs/e9b7fc70551fcd2e52077d58d2c3bcee2428cf8d#actionlint github:NixOS/nixpkgs/e9b7fc70551fcd2e52077d58d2c3bcee2428cf8d#shellcheck -c actionlint .github/workflows/iyarc-prune.yml

Exit 0, no workflow diagnostics. Nix emitted the previously observed eval-cores and lazy-trees setting warnings.

Additional runtime checks exercised the actual YAML helper loader with the pinned publisher against a local Git remote, and installed/executed the real Linux scanner in a container without repository dependencies. Runtime evidence. GitHub verifies the refactor commit's signature.

Live verification still required

No successful hosted master run is claimed. After merge, dispatch from Use workflow from: master and verify model access, generated commit signature, pull request, labels, assignment, and required checks. The repository setting allowing Actions to create pull requests could not be read with the available token (403).

Generated pull requests use GITHUB_TOKEN; a maintainer may need to select Approve workflows to run before required checks start. Current GitHub behavior.

Ticket

WAL-2232

@zahin-mohammad
zahin-mohammad requested review from a team as code owners October 28, 2026 18:00

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

WAL-2232

@zahin-mohammad
zahin-mohammad marked this pull request as draft October 28, 2026 18:00
@zahin-mohammad

Copy link
Copy Markdown
Contributor Author

@claude review always

@github-actions

This comment was marked as outdated.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread .github/workflows/iyarc-prune.yml Resolved
Comment thread .github/workflows/iyarc-prune.yml Resolved
Comment thread .github/workflows/iyarc-prune.yml Resolved
Comment thread .claude/agents/iyarc-prune.md Resolved
zahin-mohammad and others added 2 commits October 28, 2026 14:33
Ticket: WAL-2232

Co-authored-by: Ralph CLI <ralph-cli@bitgo.com>
Ralph: 18.12.3-bitgo.6 openrouter/openai/gpt-6.1-sol@default:high openrouter/z-ai/glm-5.3-flash@smol:low+task:medium openrouter/z-ai/glm-5.3@slow:max
@zahin-mohammad

This comment was marked as outdated.

@zahin-mohammad

This comment was marked as outdated.

@zahin-mohammad
zahin-mohammad marked this pull request as ready for review October 30, 2026 15:57

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@zahin-mohammad
zahin-mohammad marked this pull request as draft October 30, 2026 15:57
@zahin-mohammad

Copy link
Copy Markdown
Contributor Author

@claude review always

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @zahin-mohammad's task in 24s —— View job


Review of PR #10087 (latest push 1bf6038)

No blocking issues. I read the final workflow top to bottom. I did not run anything, including your decision harness.

The earlier concerns are addressed:

  • Agent commits: BASE_SHA comes from the checkout output, and the step fails if HEAD moved. The file check also covers staged and untracked files.
  • Label colors: labels are created only when missing, without --force.
  • Scanner: it is installed with a pinned checksum before the agent runs.
  • PR CI: the warning and the job summary now tell a maintainer to approve pending runs.

Optional follow-ups:

  1. Dedupe check runs after the agent. The open-PR check in "Check changes are ready" happens after the agent step. If a prune PR is already open, the run still pays for the full agent run and then discards the result. A cheap gh pr list step before "Run Claude Code" would skip it. The same check after the agent can stay as a race guard.
  2. Fail-closed on stray untracked files. git ls-files --others --exclude-standard rejects any non-ignored file the agent's build or test runs leave behind, such as a scratch log. That is safe, but one stray file discards a validated run. Consider ignoring files that are not under the allowlist only if they are untracked, since add-paths already keeps them out of the commit. Keeping it strict is also defensible.
  3. Agent token scope. The agent step has GH_TOKEN and contents: write, so it could push on its own despite the "do not commit" instruction. The HEAD guard catches a local commit but not a push to another branch. This is low risk, but a note in the agent doc, or dropping GH_TOKEN from that step if the agent doesn't need it, would tighten it.
  4. Commit footer. The commit message in create-pull-request says Ticket: HSM-429, while this PR is WAL-2232. Confirm that is the intended ticket for the generated commits.
  5. Live verification still open. As you noted, the following can only be checked after merge: the "Allow GitHub Actions to create and approve pull requests" setting, the commit signature, and Linux scanner execution. Dispatch from master once and check those.
    · Branch: codex/WAL-2232-iyarc-prune-create-pr

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Ticket: WAL-2232

Co-authored-by: Ralph CLI <ralph-cli@bitgo.com>
Ralph: 18.12.3-bitgo.6 openrouter/openai/gpt-6.1-sol@default:high openrouter/z-ai/glm-5.3-flash@smol:low+task:medium openrouter/z-ai/glm-5.3@slow:max

This branch has not been deployed

No deployments
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.

1 participant