Commit Graph
9 Commits
  • refactor(ci): add an adversarial pass and name the analyst briefing
    REVIEW.md told the reviewer which repository rules to check but never to try
    breaking the change, so the conditions this panel actually meets went
    unexamined. "Try to break it" adds six, each tied to a mechanism here rather
    than to a generic checklist: an upgrade over an operator's existing rows and
    the rollback that reads them again, a restart that drops in-memory state under
    the cron jobs, a sub-node racing the master on the same row, an operation
    applied twice, an inbound or client at the empty and the thousand end, and a
    dependency that is down. It closes with the gate that running a case is not
    reporting it - each one still has to clear the verification bar below it, so
    the section cannot become a licence for hypotheticals.
    
    repo-context.md said nothing about which bot reads it. Only the issue analyst
    does, since the review job's briefing moved inline in acf3603d, so it becomes
    issue-analyst-context.md and its title names the analyst instead of "the Claude
    bot". bot_context_test.go pins that path in a constant, so the rename carries
    through the constant, the four test names and the two comments that named the
    old file - one of which still said "the bot prompts", plural.
    
    Backticks come off mtg-multi in the new section: the same test file reads any
    hyphenated backticked token in REVIEW.md as a CI job name, and fails on one
    ci.yml does not define.
  • refactor(ci): review pull requests with one senior-engineer role
    The review job ran the official code-review plugin, which fans a pull
    request out to five Sonnet reviewers plus a Haiku scorer per finding and
    drops everything scored under 80, and the briefing file spent most of its
    lines overriding that plugin. Both are gone: the job hands one Senior
    Software Engineer prompt to the action inline, the way the issue analyst
    does, and denies the Agent tool so the single role is mechanical rather
    than a request.
    
    REVIEW.md moves from the emoji markers to CRITICAL/HIGH/MEDIUM/LOW with a
    pre-existing qualifier. The uncapped rule is scoped to findings the pull
    request introduced or worsened so it cannot collide with the cap of three
    pre-existing ones. "A finding is a report, not a patch" stays as it was.
    
    Workflow housekeeping: GH_TOKEN, REPO and PR live in the job env instead
    of six step copies; the skip gate is per pull request, so a head pushed
    after the automatic review is reviewed only on @claude review; the comment
    counters sum gh's per-page jq output, which read "0\n0" as a review on a
    pull request with more than 100 comments; --max-turns rises to 300 because
    every read now costs the single agent a turn instead of a subagent.
  • refactor(ci): make the Claude workflow review pull requests and nothing else
    claude-bot.yml ran three jobs: the pull-request review, an @claude mention
    responder, and a conflict resolver that committed and pushed to contributor
    branches. Only the review is wanted, so the other two are gone and the file
    is renamed to say what is left.
    
    Consequences worth knowing:
    
    - secrets.CLAUDE_BOT_PAT is no longer referenced by any workflow. It was the
      only push credential handed to an agent in this repository and can now be
      deleted from the repository settings.
    - @claude goes unanswered everywhere. claude-issue-analyst.yml deliberately
      excludes mentions (!contains(body, '@claude')) so the two jobs would not
      both reply; with the mention job gone, only `@claude review` on a pull
      request still reaches anything. Dropping that clause from the analyst would
      restore mention answering on issues.
    - The workflow display name changes, so a branch protection rule keyed on
      "Claude Bot / review" has to become "Claude PR Review / review". The job
      name, which is what statusCheckRollup reports, is unchanged.
    
    The review job itself is byte-identical. The workflow-level permission drops
    to issues: read, which is all the remaining job needs - it already declares
    its own.
  • docs(claude): teach the bot briefings about AmneziaWG and PIA
    `grep -ci amneziawg` returned 0 in both .github/claude/repo-context.md and
    REVIEW.md while CLAUDE.md has carried the protocol for releases. The issue
    analyst and the review bot could not name internal/amneziawg/,
    internal/amneziawgnet/ or internal/pia/, and the mention job's inline map
    enumerated ten protocols with amneziawg missing from the list.
    
    The 3.1 obfuscation parameters are generated twice - GenerateObfuscation31 in
    internal/amneziawg/params.go and generateAwgObfuscation in
    frontend/src/lib/xray/amneziawg-obfuscation.ts - so REVIEW.md now names that
    pair as a divergence surface next to the three link implementations. Commit
    bd1c27b0 was already a bug in exactly that pair.
    
    Also corrects the CLAUDE.md CLI list, which omitted encrypt-tokens.
  • fix(ci): stop the review bot handing over fixes in prose
    The `suggestion` blocks stopped once the briefing moved into its own file, but
    the carve-out that survived — "one clause naming where the fix belongs" — was
    being stretched from a location into an instruction. #6397 dictated what to
    write in a comment and which existing test to copy; #6394 named the fix
    outright. The clause now permits a file, a function, a symbol or a layer and
    nothing about what happens there, and closes the stretch three ways: prose is
    a patch the moment a verb describes the change, so is holding up an existing
    symbol as the model to copy, and a clause the maintainer could apply as
    written is the fix however it is punctuated.
    
    Three rules the rubric was missing, none of which existed anywhere. A 🔴 or 🟡
    says in one clause what the change did to the code it is about, the way a 🟣
    already says it predates it — otherwise nothing in the comment shows the
    marker was earned. A claim about a caller or a callee needs that file read:
    the dispatch-rule violation this repo cares most about sits a frame outside
    the diff, and the skill is told to avoid reading past the changes. And nothing
    pads the comment.
    
    The briefing's one named override aimed at a step that does not exist. The
    plugin the job loads defines no `--comment` flag and mentions suggestions
    nowhere, so `max --comment <target>` is inert trailing text. Replaced with the
    six overrides that are real: the skill calls pre-existing issues and unmodified
    lines false positives, drops every finding its confidence pass scores under 80
    and then posts nothing at all (a nitpick scores 50, so that filter empties all
    five nit slots), says to avoid emojis against a severity system that is three
    of them, mandates a "Found N issues" format, and forbids reading build signal.
  • refactor(ci): split the issue analyst out and brief the review job from a file
    The issue analyst moves verbatim from claude-bot.yml into its own
    claude-issue-analyst.yml, so claude-bot.yml now holds only the pull-request
    side: review, @claude mentions and conflict resolution.
    
    The review job's briefing was a single 2,600-character quoted string inside
    claude_args, unreadable and unreviewable. It now lives in
    .github/claude/review-job.md, assembled at run time with a "This run"
    section that hands the reviewer the pinned head SHA, the pull request and
    the exact check-runs command, and reaches the CLI through
    --append-system-prompt-file. The agent-mode action sets no system-prompt
    append of its own, so the file flag cannot collide with one.
    
    Findings no longer carry the fix: REVIEW.md and the brief both forbid
    suggestion blocks, patches and replacement snippets, overriding the
    code-review skill's --comment step, which attaches a committable suggestion
    to any small fix. A finding states what is wrong, where, what triggers it
    and what breaks; the maintainer decides the change.
  • chore(build): bump Go toolchain to 1.27.0
    Go 1.27.0 shipped on 2026-08-19. Raise the go directive and the builder
    image so Docker and release builds pick it up; every CI job already reads
    the version from go.mod, and golangci-lint v2.13.1 release binaries are
    themselves built with go1.27.0, so the lint job needs no pin change.
  • refactor(ci): replace the in-house review lanes with the official code-review skill
    The four pull_request_target review jobs in claude-bot.yml (Senior
    Developer / QA / Tester / Arbiter and their shared rubric) are replaced by
    a single review job running the official code-review plugin - the same
    skill behind Anthropic's hosted Code Review and the review workflow
    /install-github-app generates. The hosted service needs a Team/Enterprise
    organisation, so the plugin runs in CI on the maintainer's subscription
    instead: inline findings on PR open and ready-for-review, plus manual
    (re-)review when the owner or a collaborator comments "@claude review".
    
    The official example triggers on pull_request, but GitHub withholds
    secrets from fork runs and essentially every 3x-ui pull request is from a
    fork, so the job keeps the lanes' pull_request_target posture: the
    workspace is the base revision and nothing from the pull request is
    checked out or executed.
    
    What the lanes uniquely knew is distilled into REVIEW.md, handed to the
    skill via --append-system-prompt and pinned by bot_context_test.go the way
    repo-context.md is: the runtime.Runtime dispatch rule, migration and
    upgrade safety, the four-step route contract chain including the unchecked
    docs copy, the i18n rule, the three link implementations, and the
    wire-format verification bar. The mention job now ignores "@claude
    review" comments on pull requests so the review trigger does not also
    wake the generic bot, and the lane-only rubric file goes with the lanes.
    
    The remaining prompts also lose their tone micro-rules (no emoji, no
    exclamation marks, no filler) and the workflow's comment banners are
    removed.