Skip to content

ci(claude-review): dead-credential canary + error-class surfacing — a revoked OAuth token was invisible for 19h #228

Closed
2 of 2 issues completed

Description

@kyle-sexton

Problem

The org secret CLAUDE_CODE_OAUTH_TOKEN went invalid at ~2026-07-22 20:35-21:10Z (usage-dead account credential). Every claude-review and claude-security-review run for the next ~19 hours failed instantly (is_error:true, 1 turn, ~0.5s, $0) across every PR in claude-code-plugins — while every workflow stayed green, because the gate deliberately passes on infrastructure failure (correct: an infra failure is not a code-quality signal). Full diagnosis + verification: melodic-software/claude-code-plugins#1122.

Three properties compounded into invisibility:

  1. Gate-passes-by-design means no red signal anywhere in CI.
  2. The literal API error is structurally unreadable: the reusable keeps show_full_output off (public-repo log hygiene — correct), ACTIONS_STEP_DEBUG reruns do not unhide the action's redaction, and a PR-branch probe workflow with show_full_output: true is skipped by claude-code-action's default-branch validation. Verified empirically on all three routes.
  3. The infra-status comment shows only {subtype, is_error, num_turns, duration_ms, total_cost_usd} — enough to see "instant $0 failure", not enough to distinguish 401 (dead token) from 429 (usage limit) from a crash.

Proposals

  1. Scheduled canary (highest value): a cron workflow on this repo's default branch running the pinned claude-code-action with a trivial 1-turn prompt ("Reply OK") against CLAUDE_CODE_OAUTH_TOKEN, a few times per day. On is_error:true it opens/updates a pinned issue (or pings a notification channel). Cost per run is cents; a dead credential surfaces within hours instead of silently degrading every consumer repo's review coverage. Lives on the default branch, so the action's workflow-validation restriction does not apply.
  2. Error-class surfacing in the infra-status comment: the SDK result's result field (or the last API error line) contains the failure class. Extract a coarse label only — auth, rate-limit, overloaded, other (e.g. regex over the redacted-safe fields or an allowlisted substring match) — and add it to the infra-status comment. No full output in public logs; one word turns a 19-hour mystery into a 1-minute diagnosis.
  3. (Optional) freshness note in the comment: include "last successful review on this repo: " so a streak of infra failures is visible as a streak.

Non-goals: failing the gate on infra errors (current pass-through behavior is correct); enabling show_full_output anywhere public.

🤖 Generated with Claude Code

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    needs-triage
    on Jul 23, 2026
  2. added
    needs-human
    and removed
    needs-triage
    on Jul 23, 2026
  3. kyle-sexton commented on Jul 23, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage brief (human-gated)

    Verification: Accepted as verified via the linked diagnosis (melodic-software/claude-code-plugins#1122) — dead-credential window and the three unreadability routes were verified empirically there; re-reproducing a revoked-token state is not feasible in triage.

    Behavioral contract (what "done" means):

    • A dead CLAUDE_CODE_OAUTH_TOKEN surfaces as an operator-visible signal within hours (scheduled canary on the default branch opening/updating a tracking issue), instead of silently degrading every consumer repo's review coverage.
    • The claude-review infra-status comment carries a coarse failure class (auth / rate-limit / overloaded / other) extracted only from redaction-safe fields — no full model output or secrets in public logs.
    • Gate pass-through on infra errors stays unchanged (explicit non-goal), as does show_full_output off.

    Why human-gated (not delegable): every proposal lands on the claude-review security ground-rules surface, where the repo's CLAUDE.md requires explicit review for changes:

    1. The canary is a new consumer surface for the org secret on a public repo (secret scoping, schedule cost, notification channel are posture decisions).
    2. Error-class extraction sits directly against the public-repo log hygiene rules (what is safe to surface from the redacted result payload is a security judgment).
    3. Choice among proposals 1–3 (and canary cadence/alert channel) is open design space.

    Work-class: C4 (security-posture/contract surface) — human-gated by the path hard gate regardless of class.

  4. kyle-sexton commented on Jul 24, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage record — routed as parent of #237 / #238

    Verified. Claims confirmed against melodic-software/claude-code-plugins#1122 (closed) and empirically against incident run 29991269948: run concluded success while the review job's check-run annotations carry the infra-failure ::error text — the green-gate invisibility this issue describes, reproduced from the live API.

    Architecture decision (operator-ratified after adversarially-verified research; deep-research run on GitHub official docs, 16 confirmed claims):

    Priority: set to priority: high by operator directive (triage default would be medium).

    This issue stays open as the tracking parent; work happens in the sub-items (#238 blocked by #237).

  5. added
    needs-human
    and removed
    needs-human
    on Jul 24, 2026
  6. kyle-sexton commented on Jul 24, 2026

    @kyle-sexton
    MemberAuthor

    Label drift fix (work-loop cycle 5): this parent's own triage brief is titled human-gated and its work is routed to sub-items #237/#238, but the needs-human label was absent after re-triage, which put the parent back on the autonomous frontier. Restored needs-human fail-closed. Note: it also carries two priority labels (priority: high + priority: medium) — left for the attended queue to reconcile.
    This comment was written by an AI agent (work-items:work-loop lane).

  7. kyle-sexton commented on Jul 24, 2026

    @kyle-sexton
    MemberAuthor

    Advisory acknowledged (attended queue): needs-human restore was correct — parent is human-gated routing shell for #237/#238. Dual priority reconciled: kept priority: high, removed priority: medium. This comment was written by an AI agent on the operator's behalf (work-items:attend-queue lane).

  8. 9 remaining items

  9. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    Automated triage agent (gate-audit lane) — lease RELEASED, work complete. This claim marker is no longer active; the gate-audit summary follows below.

  10. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This comment was written by an automated triage agent (gate-audit lane), on the operator's behalf. It answers a dangling question in this thread and records parent state — it does not decide, execute, or change the ratified design.

    Gate audit: gate is legitimate; the last comment's open question is already closed

    RECOMMENDED — keep needs-human, no action on this parent. This issue is the operator-ratified decision carrier / routing shell for its two children (ratification 2026-07-26). All of its own design decisions are settled; the parent needs nothing from a human right now and should close when its last child lands. Verified independently this cycle: the gate is correctly applied, not label drift.

    Alternative (not recommended): close this parent now as fully-routed and track the remainder on #238 only. Rejected because the ratified design record and incident evidence live here, and #238 references them.

    Two state changes since the last comment in this thread

    1. claude-review: emit machine-readable infra-failure class (auth/rate-limit/overloaded/other) #237 is done. Closed 2026-07-26T08:52:50Z, merged via feat(claude-review,claude-security-review): emit a machine-readable infra-failure class #248. The machine-readable infra-failure class shipped, so half the routed work is complete.
    2. The design question this thread ends on has been answered. The previous comment closed by flagging: "Whether the aggregator should escalate on any infra class, or only on auth, is a real design question this incident raises — I am not deciding it here." That was decided about three hours later, on the child: ANY-CLASS-ROUTED — open on sustained failure of any class, apply the human gate by class. Reading this thread top-to-bottom otherwise ends on a question that is no longer open.

    Remaining work

    Only #238, which carries its own operator-recorded Work-class: C3 (feature-shaped) and stays needs-human under this repo's admission gate (feature-shaped C3 has no autonomous-dispatch path). Nothing on this parent blocks it.

    Also unchanged and still correct: the synthetic-canary rejection and its deferral trigger ("a quiet-period credential death causes real missed-review harm") — the 2026-07-25/26 recurrence did not meet it (159 organic runs inside the window).

  11. kyle-sexton commented on Aug 6, 2026

    @kyle-sexton
    MemberAuthor

    The Phase 4 acceptance test strengthened the case for Proposal 1 (the scheduled canary)

    Staying open. Evidence and the full acceptance ledger are on #238; this note is only about what the run says about this issue's premises.

    Error-class surfacing (Proposal 2) works. The forced-failure fixture produced exactly the one-word diagnosis this issue asked for: annotation class=auth carrying api_error_status: 401, and a marker comment reading Failure class: auth. The 19-hour mystery this issue opened about would now be a one-minute read. That part is delivered.

    But the canary is no longer just the highest-value proposal — it covers a gap nothing else can. Two findings from the run:

    1. A silent green with no class token at all. When claude-code-action skips itself on workflow validation, it exits 0, the check concludes green, nothing is reviewed, and no class= token is emitted (the outcome step took its success path — LANE_OUTCOME: success). The incident aggregator's entire detection mechanism is that token, so this failure mode is invisible to it by construction. Filed as claude-review: a workflow-validation skip is an undetectable silent no-review, plus a false review count and false marker copy #363. An annotation-based receiver cannot fix this; a probe that asks "did a review actually happen?" is the only proposed mechanism that would.

    2. The aggregator's own write path had never once executed, and 145 consecutive green runs hid it. Each emitted cycle=clean read-errors=0 — the positive-signal line intended as the antidote to "absence of an incident is not evidence of health" — while no incident could have been written at all. Fixed in fix(claude-lane-incident): upload the dot-prefixed incident body #359. The lesson is uncomfortable and directly on this issue's theme: the watchdog's own liveness signal was itself the thing that was lying, and only an end-to-end forced failure caught it. A watchdog that never fires and a watchdog that cannot fire look identical from the outside.

    Together these say the deferral trigger recorded on #238 — "a quiet-period credential death causes real missed-review harm" — is not the only trigger worth watching. A no-token silent green in a consumer repo would be equally decisive, and by definition it would arrive with no signal attached.

    Recorded in PLAN.md's Phase 4 ledger with a dated re-evaluation of 2026-11-06, or earlier on either original trigger or on a first observed no-token silent green.

    One housekeeping note: while this issue stays open it is the only place in the org tracking the canary deferral. If it is ever closed, that decision and its trigger need a home first — otherwise they survive only in the body of a closed issue.

    🤖 Generated with Claude Code

  12. kyle-sexton commented on Aug 7, 2026

    @kyle-sexton
    MemberAuthor

    Closing on operator authorization (interactive session, 2026-08-07). Disposition:

    • Proposal 2 (error-class surfacing): shipped and empirically proven in the Phase 4 acceptance run (see 2026-08-06 comment) — the original 19h-invisible dead-credential harm is now surfaced by class.
    • Proposal 1 (scheduled canary): remains rejected per the ratified plan. The 2026-08-06 "strengthened the case" note stays recorded in this thread; if the canary is revisited, file a fresh item referencing this thread rather than reopening.

    This comment was written by an AI agent on the operator's behalf, on explicit operator instruction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions