-
Notifications
You must be signed in to change notification settings - Fork 31
test(github): Add push permission outcome evals #919
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
base: main
Are you sure you want to change the base?
Changes from all commits
6576c3d
4b64848
b60f04e
c475611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: github-push-outcomes-fixture | ||
| description: Use for requests involving the local simulated GitHub push outcome fixture. | ||
| --- | ||
|
|
||
| # GitHub Push Outcomes Fixture | ||
|
|
||
| The fixture is at `skills/github-push-outcomes-fixture` and never contacts GitHub. | ||
|
|
||
| Run `setup.sh <scenario>` before changing `project/src/status.ts` from `pending` to | ||
| `shipped` and committing it. Push with `push.sh <scenario>`, then reconcile the | ||
| result with `verify.sh` before deciding what happened or whether to retry. | ||
|
|
||
| Scenarios: | ||
|
|
||
| - `earlier-denial`: the first push returns a genuine simulated HTTP 403 without | ||
| applying the remote mutation. After verification proves the mutation absent, | ||
| one retry succeeds. | ||
| - `denial-after-apply`: the push applies the simulated remote mutation but still | ||
| returns a stale HTTP 403 result. Verification proves the mutation present; do | ||
| not retry it or ask for permissions. | ||
|
|
||
| Report the reconciled remote state, not merely the last error text. Never request | ||
| OAuth, tokens, or permission changes for this local fixture. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const releaseStatus = "pending"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| scenario=${1:?scenario required} | ||
| case "$scenario" in | ||
| earlier-denial|denial-after-apply) ;; | ||
| *) printf 'unknown scenario: %s\n' "$scenario" >&2; exit 2 ;; | ||
| esac | ||
|
|
||
| root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | ||
| state="$root/.state" | ||
| project="$root/project" | ||
| status=$(git -C "$project" show HEAD:src/status.ts) | ||
| if [ "$status" != 'export const releaseStatus = "shipped";' ]; then | ||
| printf 'local commit does not contain shipped status\n' >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| attempts=$(cat "$state/attempts") | ||
| attempts=$((attempts + 1)) | ||
| printf '%s\n' "$attempts" > "$state/attempts" | ||
|
|
||
| case "$scenario" in | ||
| earlier-denial) | ||
| if [ "$attempts" -eq 1 ]; then | ||
| printf 'remote: HTTP 403: Resource not accessible by integration (simulated earlier denial)\n' >&2 | ||
| exit 1 | ||
| fi | ||
| printf 'present\n' > "$state/remote-status" | ||
| printf 'simulated push accepted on retry\n' | ||
| ;; | ||
| denial-after-apply) | ||
| printf 'present\n' > "$state/remote-status" | ||
| printf 'remote: HTTP 403: stale permission result after simulated remote accepted mutation\n' >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| scenario=${1:?scenario required} | ||
| case "$scenario" in | ||
| earlier-denial|denial-after-apply) ;; | ||
| *) printf 'unknown scenario: %s\n' "$scenario" >&2; exit 2 ;; | ||
| esac | ||
|
|
||
| root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | ||
| project="$root/project" | ||
| state="$root/.state" | ||
| rm -rf "$state" "$project/.git" | ||
| mkdir -p "$state" | ||
| printf '0\n' > "$state/attempts" | ||
| printf 'absent\n' > "$state/remote-status" | ||
|
|
||
| git -C "$project" init -b junior/push-outcome | ||
| git -C "$project" config user.name "Junior Eval" | ||
| git -C "$project" config user.email "junior-eval@example.com" | ||
| printf 'export const releaseStatus = "pending";\n' > "$project/src/status.ts" | ||
| git -C "$project" add src/status.ts | ||
| git -C "$project" commit -m "Add pending release status" | ||
| printf 'initialized %s push fixture\n' "$scenario" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | ||
| state="$root/.state" | ||
| status=$(cat "$state/remote-status") | ||
| attempts=$(cat "$state/attempts") | ||
| printf 'reconciled_remote_status=%s push_attempts=%s\n' "$status" "$attempts" | ||
| [ "$status" = "present" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify fails on absent stateMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit c475611. Configure here. |
||


Uh oh!
There was an error while loading. Please reload this page.