Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

GitHub inbox: add an automation rule from any item so similar items are handled on Autopilot

Chiusa
#13,192 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #13231 di @atomantic — integrata

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

area:devtools effort:high enhancement model:heavy plan

Problem

Agent rules cover only three notification kinds (GITHUB_AGENT_RULE_KINDS: review-request, security-alert, issue-activity) and one action, start an agent or don't. They are created only from the Automations tab. While going through the inbox, the operator wants to tap Add automation rule on any item and have every similar item handled the same way on Autopilot. Examples: "every default-branch CI failure in this repo → mark done", "every subscribed issue in this repo → resolve with agent".

Learned rules (github_notification_rules, keyed on repo × reason × actor) already do part of this, but only by inference from Done/Mute taps. They need two matching corrections before they quiet anything, and they cannot start an agent.

Decision

Extend agent rules into automation rules and let them be created from a row.

  • Kinds (GITHUB_AGENT_RULE_KINDS, RULE_KINDS / threadAgentKind in lib/githubNotificationTriage.js, AGENT_RULE_KINDS in githubTriageLabels.js): add ci-failure, own-pr, mention, release and other to the existing three. threadAgentKind stays the single classifier and is derived from reason and subject type only.
  • Action replaces the agent: boolean field: action: 'agent' | 'done' | 'mute' | 'leave'. Stored agent: true/false rules are read as agent/leave. Coerce on read; validate on write. Agent rules keep their provider/model/effort pin.
  • Apply: Autopilot runs agent rules through the lane selection from the generic resolve-with-agent issue. Assist and Autopilot apply done and mute rules as automation actions (undoable, logged). The rules never override the suspect, security-alert or invitation pins (PINNED_RULES), and an agent rule on an outside thread still routes only to screened lanes.
  • From a row: the row's overflow gets Add automation rule…, which opens the rule form prefilled with this thread's kind and repo. "All repos" is one click away. The form shows how many open threads the rule would match right now, and offers "Apply to these N now" on save.
  • Parity guard: CANDIDATE_SQL in githubNotificationAutopilot.js is a hand-written SQL mirror of agentHandoff + agentRuleScope. Add a table-driven test that runs one fixture per kind × action through both the JS planner and the SQL candidate query (DB test), and fails on any disagreement. Without it, a kind added in JS silently never runs on Autopilot.

Affected files

  • server/lib/validation.js: the rule schema (action, the new kinds; legacy agent still accepted).
  • server/lib/githubNotificationTriage.js: threadAgentKind, matchAgentRule, agentRuleScope, autopilotHandoff, a new ruleAction.
  • server/services/githubNotificationAutopilot.js: CANDIDATE_SQL, rule-driven done/mute.
  • server/services/githubNotificationAssist.js: applying done/mute rules.
  • client/src/components/github/GitHubAgentRules.jsx, GitHubInboxTab.jsx, githubTriageLabels.js.
  • server/services/githubNotifications.db.test.js: the parity test.

Acceptance criteria

  • From an inbox row, the operator can save "CI failures in repo X → done". The next Autopilot or Assist run marks every matching open thread done, as undoable automation events.
  • A stored legacy { agent: true } rule still hands off exactly as before.
  • A done rule never acts on a suspect thread or a security alert.
  • The JS/SQL parity test goes red when a kind is added to threadAgentKind without CANDIDATE_SQL (verified by breaking it once).

model:heavy / effort:high: a schema change with a legacy-read contract, plus a JS↔SQL invariant that has to stay mirrored.

The agent action on kinds with no lane today depends on #13191; the done / mute actions can ship first.

Lingua principale
JavaScript
Stelle
38
Fork
32
Merge medio
41m
PR unite (30g)
991

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di atomantic/PortOS

Tutte le issue di atomantic/PortOS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.