Skip to content

[TEST — do not merge] #417 empirical 401 check - #420

Closed
d-morrison wants to merge 1 commit into
mainfrom
test/417-dispatch-401-check
Closed

[TEST — do not merge] #417 empirical 401 check#420
d-morrison wants to merge 1 commit into
mainfrom
test/417-dispatch-401-check

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Throwaway test for #417 finding 1. Edits claude-review.yml (so the self-review guard would skip on automatic runs) and repoints its callee at the fix-self-review-mention-skip branch (so the review runs #417's IS_DISPATCH bypass). A workflow_dispatch with pr_number set triggers IS_DISPATCH=true → bypasses the skip. Observing: does the action 401 (workflow validation, reviewer's finding 1) or post a real verdict (fix works)? Will be closed after.

…on-skip

THROWAWAY empirical test for #417 finding 1. This PR edits claude-review.yml
(the caller stub) AND routes its review through #417's claude-code-review.yml
(IS_DISPATCH bypass). A workflow_dispatch with pr_number set will bypass the
self-review skip; we observe whether the action 401s (workflow validation) or
posts a real verdict. To be closed after.
@d-morrison

Copy link
Copy Markdown
Collaborator Author

Throwaway test complete. Result: dispatching a review on a PR that edits the caller workflow, with #417's IS_DISPATCH bypass, makes the claude-code-action hit 'Workflow validation failed' and exit with no output — turning claude-review/require-review red. Confirms #417 finding 1. Closing.

@d-morrison d-morrison closed this Aug 5, 2026
@d-morrison
d-morrison deleted the test/417-dispatch-401-check branch August 5, 2026 23:43
github-actions Bot added a commit that referenced this pull request Aug 5, 2026
Empirical test (#420) confirmed the IS_DISPATCH bypass
trades gha#286's silent skip for a red required-check failure instead
of fixing it: a dispatched/mentioned run on a PR editing the caller
workflow still executes that PR's modified copy, so claude-code-action's
App-token exchange 401s regardless of trigger type. Reverting both the
workflow change and its CLAUDE.md documentation back to main; gha#286's
silent-skip limitation remains open and documented as-is. A real fix
would need to pass claude-code-action a non-OIDC github_token override,
which is a separate security/secret decision left for a future PR.
d-morrison added a commit that referenced this pull request Aug 6, 2026
- The validation skip is reachable today, not only via a deliberate
  bypass: the self_mod guard reads files via 'gh api ... || true', so a
  transient gh api failure fails open (self_mod=false) on a caller-editing
  PR and the review proceeds into the content-validation skip. Note both
  paths (deliberate #417-style bypass; live fail-open).
- Drop the self-contradictory '(e.g. by the github_token fix below)' from
  the diagnostic-tells intro (the override prevents the skip, and it was a
  forward reference).
- Downgrade 'the real fix (proven via #420)' to 'likely (untested) fix':
  #420 only proved the bypass counterproductive; the override was never
  exercised and has no input wired up. Same softening in the changelog.
d-morrison added a commit that referenced this pull request Aug 6, 2026
#422)

* docs: record the claude-code-action workflow-validation skip signature

A PR that edits the review workflow and bypasses the self-review skip guard
(e.g. an @claude review dispatch, as #417 attempted) still gets no verdict:
anthropics/claude-code-action validates its own content against the default
branch and gracefully skips on a mismatch, producing outcome=success, a
sub-15s run, and no execution output -- so check-review-execution.sh reddens
claude-review/require-review with no verdict.

Record that this does NOT surface as a literal 401 in the log (the signature
is 'Workflow validation failed' / 'Exiting due to workflow validation skip'),
the diagnostic tells, that bypassing the self-review skip does not help since
validation keys on workflow content vs the default branch, and that a
github_token override on the action is the real fix. Proven empirically via
throwaway test PR #420 on 2026-08-05.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: correct workflow-validation-skip note now that #417 is abandoned

Address #422 review:
- Fix the factual framing: dispatch does NOT bypass self_mod today (the
  guard's PR_NUMBER resolves the same regardless of trigger, per the
  gha#286 example); bypassing it was gha#417's proposal, now abandoned.
  Reframe as 'why the guard exists / why bypassing it fails', past-tense.
- Timing tell is step-level (~4-11s), not a job-level ~15s; note total
  job time is unreliable (checkout/installs run first).
- Name the caller workflow claude-review.yml; use self_mod terminology;
  keep '@claude review' code spans intact on one line.
- Same corrections in the changelog fragment.

* docs: correct fail-open path and untested-fix overclaim (#422 review)

- The validation skip is reachable today, not only via a deliberate
  bypass: the self_mod guard reads files via 'gh api ... || true', so a
  transient gh api failure fails open (self_mod=false) on a caller-editing
  PR and the review proceeds into the content-validation skip. Note both
  paths (deliberate #417-style bypass; live fail-open).
- Drop the self-contradictory '(e.g. by the github_token fix below)' from
  the diagnostic-tells intro (the override prevents the skip, and it was a
  forward reference).
- Downgrade 'the real fix (proven via #420)' to 'likely (untested) fix':
  #420 only proved the bypass counterproductive; the override was never
  exercised and has no input wired up. Same softening in the changelog.

* docs: semantic line breaks in the fail-open paragraph (one sentence per line)

* docs: 'skips every step of the review job' (job runs green, not skipped)

Address #422 review: the self_mod guard is step-level; the job still runs
and reports success (green), so 'skips the whole review job' was imprecise
and contradicted the paragraph's own 'green job, every post-guard step
skipped' clause.

* docs: cross-link the two OIDC-validation sections; reconcile github_token confidence; add fail-open path to changelog

Address #422 review round 4:
- Cross-link the workflow-validation-skip note and the 'Test changes
  against a template repo' section (same OIDC mechanism, two angles) so
  neither re-derives the other uncited (item 10).
- Add the 'untested' caveat to that section's github_token mention so both
  passages state the fix with the same confidence.
- Fold the fail-open gh-api path into the changelog fragment, which had
  only the deliberate-bypass path (a changelog reader lacks the CLAUDE.md
  context).

* docs: drop forward-ref to 'Never just theorize' section; add (#422) to changelog bullet

* docs: drop 'for the reason below' forward signpost (reason emerges inline)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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