Skip to content

land: gh-shim-rename-guard - #549

Merged
ualtinok merged 6 commits into
mainfrom
land/gh-shim-rename-guard
Oct 18, 2026
Merged

ualtinok merged 6 commits into
mainfrom
land/gh-shim-rename-guard

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Adds a preflight guard to operator-bypassed repo rename so it refuses when the repository publishes reusable workflows or actions that other repositories reference, since GitHub does not redirect those references after a rename. The check fails closed when it cannot verify the repository is safe (API errors, truncated trees, unparseable workflow YAML, or limits).

  • Operators can override the refusal with GH_SHIM_RENAME_PUBLISHED=allow, which still runs the bounded inspection but records the published paths or unverified reason in the operator audit.
  • New refusal codes gh_shim_rename_published and gh_shim_rename_unverified are added to the closed set.
  • Process-tree cleanup for preflight timeouts is shared across the crate, and the timeout tests now tolerate loaded runners.

Written for commit 431a7f9. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.

Summary

Adds a preflight check before operator-bypassed repo rename to detect reusable workflows and actions.

  • Operator-bypassed repository renames check for published actions and workflows.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Operator-bypassed repo rename] --> B[Inspect repository]
  B --> C{Safe or explicit override?}
  C -->|No| D[Refuse rename]
  C -->|Yes| E[Write and sync audit]
  E --> F{Audit saved?}
  F -->|No| D
  F -->|Yes| G[Delegate to gh]
Loading

Reviews (3) · Last reviewed commit: "gh-shim: leave room for nested PowerShel..." · Reviewed by Greptile

ualtinok and others added 3 commits October 18, 2026 17:59
Refuse published reusable workflows/actions and unverified inspections before audited operator delegation. Resolve the existing repository through real gh, inspect one bounded default-branch tree, parse workflow YAML, and provide an exact audited override.

The v19 classifier bypass test now explicitly opts into the rename override: unconditional bypass admission is no longer safe. Extend the closed refusal-code set for the two new failures. The reviewed v19 manifest stays unchanged.

Verified 234 shim unit tests, 83 shim integration tests (serial to avoid an unrelated shared-env race), 182 list-envelope tests, Windows warnings-denied cross-check, and formatting. YAML-trigger and truncated-tree mutants each failed exactly their named regression test; restored suite passed all 12 controls.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread crates/aft/src/gh_shim/rename_guard.rs Outdated
Comment thread crates/aft/src/gh_shim/v19_tests.rs Outdated
ualtinok and others added 2 commits October 18, 2026 19:38
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
A 100 ms deadline and a 2 s elapsed bound can flake on loaded CI runners,
and the grandchild test could panic if the shell had not yet recorded the
pid. Deadlines of 1-3 s with a 15 s bound still prove the timeout does not
wait for the 30 s descendant.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
@ualtinok
ualtinok removed this pull request from the merge queue due to a manual request Oct 18, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 18, 2026
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
@ualtinok
ualtinok removed this pull request from the merge queue due to a manual request Oct 18, 2026
…child timeout test

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit a7bb0e1 Oct 18, 2026
49 checks passed
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