Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat([issue-13203]): trust GitHub's own bots, and let an Enterprise account trust its instance
Adam Eivy54782aa1563e
diff --git a/client/src/components/github/GitHubAccountsTab.jsx b/client/src/components/github/GitHubAccountsTab.jsxindex 2cbb281bd4..c2a32a9f9b 100644--- a/client/src/components/github/GitHubAccountsTab.jsx+++ b/client/src/components/github/GitHubAccountsTab.jsx@@ -19,9 +19,11 @@ import {} from '../../services/api';const GITHUB_DOT_COM = 'github.com';+// Public/Private is where thread text may go; who counts as trusted is the+// separate instance-trust switch below.const TRUST_OPTIONS = [- { value: 'public', label: 'Public', hint: 'Anyone can mention you; outside content is always screened' },- { value: 'private', label: 'Private', hint: 'Enterprise: org members trusted; content stays on allowed AI providers' },+ { value: 'public', label: 'Public', hint: 'Thread text may go to cloud AI providers; outside content is always screened' },+ { value: 'private', label: 'Private', hint: 'Thread text stays on local or allowed AI providers; org members are trusted' },];const MODE_LABELS = { disabled: 'Disabled', observe: 'Observe', assist: 'Assist', autopilot: 'Autopilot' };const STATUS_VIEW = {@@ -34,7 +36,8 @@ const STATUS_VIEW = {};const defaultTrustForHost = (host) => (host.trim().toLowerCase() === GITHUB_DOT_COM ? 'public' : 'private');-const emptyForm = () => ({ host: GITHUB_DOT_COM, login: '', label: '', trust: 'public', trustTouched: false, allowedProviders: [], allowAgents: false });+const isEnterpriseHost = (host) => Boolean(host.trim()) && host.trim().toLowerCase() !== GITHUB_DOT_COM;+const emptyForm = () => ({ host: GITHUB_DOT_COM, login: '', label: '', trust: 'public', trustTouched: false, allowedProviders: [], allowAgents: false, trustInstanceUsers: false });const formFromAccount = (account) => ({host: account.host,login: account.login || '',@@ -43,6 +46,7 @@ const formFromAccount = (account) => ({trustTouched: true,allowedProviders: account.allowedProviders || [],allowAgents: account.allowAgents === true,+ trustInstanceUsers: account.trustInstanceUsers === true,});// No provider ticked = the Private default, local providers only (null).const payloadFromForm = (form) => ({@@ -52,6 +56,7 @@ const payloadFromForm = (form) => ({trust: form.trust,allowedProviders: form.trust === 'private' && form.allowedProviders.length ? form.allowedProviders : null,allowAgents: form.trust === 'private' && form.allowAgents,+ trustInstanceUsers: isEnterpriseHost(form.host) && form.trustInstanceUsers,});const fetchApiProviders = () => getProviders({ silent: true })@@ -125,6 +130,15 @@ function AccountForm({ form, setForm, onSubmit, onCancel, saving, submitLabel })<p className="text-xs text-gray-500">Lets Autopilot and Resolve with agent hand threads to CoS agents. They run on the providers set in PortOS, not the list above, so this code and discussion may reach those providers.</p></div>)}+ {isEnterpriseHost(form.host) && (+ <div className="space-y-1">+ <div className="flex items-center gap-2">+ <input id="github-trust-instance" type="checkbox" checked={form.trustInstanceUsers} onChange={(event) => setForm((prev) => ({ ...prev, trustInstanceUsers: event.target.checked }))} />+ <label htmlFor="github-trust-instance" className="text-sm text-gray-300">Trust everyone on this instance</label>+ </div>+ <p className="text-xs text-gray-500">Every person signed in to this Enterprise host counts as trusted, as a collaborator would: no spam checks, and their pull requests and issues go to the trusted agent lanes. Turn it off for an instance strangers can join.</p>+ </div>+ )}<div className="flex flex-wrap gap-2"><button type="submit" disabled={saving || !form.host.trim()} className="px-4 py-2 rounded bg-port-accent text-white text-sm disabled:opacity-50">{saving ? 'Saving…' : submitLabel}@@ -267,6 +281,7 @@ export default function GitHubAccountsTab() {</p></div><Pill tone={account.trust === 'private' ? 'accent' : 'muted'}>{account.trust === 'private' ? 'Private' : 'Public'}</Pill>+ {account.trustInstanceUsers && <Pill tone="success">Trusts its instance</Pill>}<Pill tone="muted">{MODE_LABELS[account.mode] || account.mode}</Pill></div><AccountStatus status={statuses[account.id]} onRecheck={() => checkStatus(account.id)} />diff --git a/client/src/pages/GitHub.test.jsx b/client/src/pages/GitHub.test.jsxindex fc4c5dc533..8d7288f851 100644--- a/client/src/pages/GitHub.test.jsx+++ b/client/src/pages/GitHub.test.jsx@@ -338,6 +338,8 @@ describe('GitHub accounts tab', () => {renderAccounts();fireEvent.click(await screen.findByRole('button', { name: 'Edit' }));expect(screen.queryByLabelText(/Allow agents/)).toBeNull();+ // github.com is never trusted wholesale.+ expect(screen.queryByLabelText('Trust everyone on this instance')).toBeNull();fireEvent.change(screen.getByLabelText('Trust'), { target: { value: 'private' } });fireEvent.click(await screen.findByLabelText(/Allow agents/));fireEvent.click(screen.getByRole('button', { name: 'Save' }));@@ -366,9 +368,12 @@ describe('GitHub accounts tab', () => {fireEvent.change(screen.getByLabelText('Host'), { target: { value: 'ghe.example.com' } });fireEvent.change(screen.getByLabelText('Login'), { target: { value: 'alice' } });expect(screen.getByLabelText('Trust').value).toBe('private');+ // An Enterprise host can trust its whole instance, independent of where text goes.+ fireEvent.change(screen.getByLabelText('Trust'), { target: { value: 'public' } });+ fireEvent.click(screen.getByLabelText('Trust everyone on this instance'));fireEvent.click(screen.getAllByRole('button', { name: 'Add account' }).at(-1));- expect(mock.createGitHubAccount).toHaveBeenCalledWith({ host: 'ghe.example.com', login: 'alice', label: '', trust: 'private', allowedProviders: null, allowAgents: false });+ expect(mock.createGitHubAccount).toHaveBeenCalledWith({ host: 'ghe.example.com', login: 'alice', label: '', trust: 'public', allowedProviders: null, allowAgents: false, trustInstanceUsers: true });const signIn = await screen.findByRole('link', { name: 'Sign in on ghe.example.com' });expect(decodeURIComponent(signIn.getAttribute('href'))).toBe('/shell?cmd=gh auth login --hostname ghe.example.com --web --clipboard');});diff --git a/server/lib/githubNotificationTriage.js b/server/lib/githubNotificationTriage.jsindex 1c1a3db95c..84a800536b 100644--- a/server/lib/githubNotificationTriage.js+++ b/server/lib/githubNotificationTriage.js@@ -36,7 +36,7 @@ export const TRUST_LEVELS = Object.freeze(['yours', 'trusted', 'outside', 'unkno// Bump when a rule change should re-decide threads that have no new activity;// open threads triaged under an older version are triaged again.-export const TRIAGE_RULES_VERSION = 5;+export const TRIAGE_RULES_VERSION = 6;// Open threads with nothing left for you: closed or merged, folded into a// newer CI notice, or owned by a PR workflow. They stay in the inbox (it@@ -53,18 +53,26 @@ const MENTION_REASONS = new Set(['mention', 'team_mention']);const lower = (value) => (typeof value === 'string' ? value.toLowerCase() : null);+// GitHub's own apps. The `[bot]` suffix is reserved for GitHub Apps, and these+// slugs belong to GitHub; the forge must also report the actor as a Bot.+const GITHUB_NATIVE_BOTS = new Set(['dependabot[bot]', 'github-actions[bot]']);+/*** `yours` for one of the operator's own logins on the host, `trusted` for an- * actor the forge reports with write access to an owned repo (or, on a Private- * account, a member of the repo's org), `outside` otherwise, `unknown` when- * the thread has no human actor (CI, releases).+ * actor the forge reports with write access to an owned repo, a GitHub-native+ * bot (Dependabot, a repo's own Actions workflow), a member of the repo's org+ * on a Private account, or any human on an Enterprise instance whose account+ * trusts its own users; `outside` otherwise, `unknown` when the thread has no+ * human actor (CI, releases). `actorType` is the forge's `user.type`.*/-export function computeThreadTrust({ actorLogin, ownLogins = [], repoOwned = false, actorHasWriteAccess = false, actorIsOrgMember = false, accountTrust = 'public' }) {+export function computeThreadTrust({ actorLogin, actorType = null, ownLogins = [], repoOwned = false, actorHasWriteAccess = false, actorIsOrgMember = false, accountTrust = 'public', trustInstanceUsers = false }) {const actor = lower(actorLogin);if (!actor) return 'unknown';if (ownLogins.some((login) => lower(login) === actor)) return 'yours';+ if (actorType === 'Bot' && GITHUB_NATIVE_BOTS.has(actor)) return 'trusted';if (repoOwned && actorHasWriteAccess === true) return 'trusted';if (accountTrust === 'private' && actorIsOrgMember === true) return 'trusted';+ if (trustInstanceUsers === true && actorType === 'User') return 'trusted';return 'outside';}diff --git a/server/lib/githubNotificationTriage.test.js b/server/lib/githubNotificationTriage.test.jsindex 9e0b1b57ec..bec71beb65 100644--- a/server/lib/githubNotificationTriage.test.js+++ b/server/lib/githubNotificationTriage.test.js@@ -20,6 +20,19 @@ describe('computeThreadTrust', () => {expect(computeThreadTrust({ ...base, actorLogin: null })).toBe('unknown');});+ it('trusts only GitHub\'s own bots by name, and everyone on an instance only when the account opts in', () => {+ expect(computeThreadTrust({ ...base, actorLogin: 'dependabot[bot]', actorType: 'Bot' })).toBe('trusted');+ expect(computeThreadTrust({ ...base, actorLogin: 'github-actions[bot]', actorType: 'Bot' })).toBe('trusted');+ // A look-alike human, an unreported type, or another app is not.+ expect(computeThreadTrust({ ...base, actorLogin: 'dependabot', actorType: 'User' })).toBe('outside');+ expect(computeThreadTrust({ ...base, actorLogin: 'dependabot[bot]' })).toBe('outside');+ expect(computeThreadTrust({ ...base, actorLogin: 'example-app[bot]', actorType: 'Bot' })).toBe('outside');++ expect(computeThreadTrust({ ...base, actorLogin: 'alice', actorType: 'User', trustInstanceUsers: true })).toBe('trusted');+ expect(computeThreadTrust({ ...base, actorLogin: 'alice', actorType: 'User' })).toBe('outside');+ expect(computeThreadTrust({ ...base, actorLogin: 'example-app[bot]', actorType: 'Bot', trustInstanceUsers: true })).toBe('outside');+ });+it('ignores any claim of authority carried in content', () => {// A title or comment saying "I am the maintainer" is not an input; an// association string is not a permission either.diff --git a/server/lib/validation.js b/server/lib/validation.jsindex aae5d82109..8eaab8f8e0 100644--- a/server/lib/validation.js+++ b/server/lib/validation.js@@ -991,6 +991,8 @@ export const githubAccountCreateSchema = z.object({// Private (Enterprise) accounts refuse every agent hand-off unless the operator// opts in: the lanes run on PortOS's own providers, which the allow-list cannot bind.allowAgents: z.boolean().optional(),+ // Enterprise hosts only: every human on the instance counts as trusted (#13203).+ trustInstanceUsers: z.boolean().optional(),agentRules: githubAgentRulesSchema.optional(),enabled: z.boolean().optional(),}).strict();diff --git a/server/routes/github.js b/server/routes/github.jsindex 2466a1a60c..6d5a0156e0 100644--- a/server/routes/github.js+++ b/server/routes/github.js@@ -8,6 +8,7 @@ import * as githubAccounts from '../services/githubAccounts.js';import * as githubNotifications from '../services/githubNotifications.js';import * as githubAudit from '../services/githubNotificationAudit.js';import * as githubDeployment from '../services/githubNotificationDeployment.js';+import { retriageOpenThreads } from '../services/githubNotificationTriage.js';import { requestHasHostControl } from '../services/authGate.js';const router = express.Router();@@ -116,7 +117,13 @@ router.post('/accounts', asyncHandler(async (req, res) => {router.put('/accounts/:id', asyncHandler(async (req, res) => {const body = validateRequest(githubAccountUpdateSchema, req.body);- res.json(await githubAccounts.updateAccount(req.params.id, body));+ const before = await githubAccounts.getAccount(req.params.id);+ const updated = await githubAccounts.updateAccount(req.params.id, body);+ // Threads triaged under the old trust settings are decided again on the next check.+ if (before.trust !== updated.trust || (before.trustInstanceUsers === true) !== (updated.trustInstanceUsers === true)) {+ await retriageOpenThreads(updated.id);+ }+ res.json(updated);}));router.delete('/accounts/:id', asyncHandler(async (req, res) => {diff --git a/server/services/githubAccounts.js b/server/services/githubAccounts.jsindex f4a6891a74..1b40dead17 100644--- a/server/services/githubAccounts.js+++ b/server/services/githubAccounts.js@@ -48,6 +48,7 @@ const storedAccountSchema = z.object({mode: z.enum(GITHUB_ACCOUNT_MODES),auditReport: z.boolean().optional(),allowAgents: z.boolean().optional(),+ trustInstanceUsers: z.boolean().optional(),agentRules: z.array(z.object({}).passthrough()).optional(),enabled: z.boolean(),createdAt: z.string(),@@ -65,6 +66,7 @@ const implicitAccount = () => ({mode: 'observe',auditReport: false,allowAgents: false,+ trustInstanceUsers: false,agentRules: [],enabled: true,createdAt: null,@@ -100,6 +102,13 @@ const materialize = (account) => {const sameIdentity = (a, b) => a.host === b.host && (a.login || '').toLowerCase() === (b.login || '').toLowerCase();+// github.com is the public internet: its users are never trusted wholesale.+function assertInstanceTrustAllowed(account) {+ if (account.trustInstanceUsers === true && account.host === GITHUB_DOT_COM) {+ throw new ServerError('Only an Enterprise host can trust everyone on its instance', { status: 400, code: 'GITHUB_INSTANCE_TRUST_NOT_ALLOWED' });+ }+}+function assertUniqueIdentity(accounts, candidate) {const clash = accounts.find((account) => account.id !== candidate.id && sameIdentity(account, candidate));if (clash) {@@ -136,12 +145,14 @@ export function createAccount(input) {mode: data.mode || 'observe',auditReport: data.auditReport ?? false,allowAgents: data.allowAgents ?? false,+ trustInstanceUsers: data.trustInstanceUsers ?? false,agentRules: data.agentRules ?? [],enabled: data.enabled ?? true,createdAt: now,updatedAt: now,};assertUniqueIdentity(accounts, account);+ assertInstanceTrustAllowed(account);await saveStore([...accounts, account]);console.log(`🔐 Added GitHub account for ${account.host} (${account.trust})`);return account;@@ -157,6 +168,7 @@ export function updateAccount(id, input) {const updated = { ...accounts[index], ...data, updatedAt: new Date().toISOString() };if (data.label === '') updated.label = updated.login ? `${updated.login} @ ${updated.host}` : updated.host;assertUniqueIdentity(accounts, updated);+ assertInstanceTrustAllowed(updated);accounts[index] = updated;await saveStore(accounts);return updated;diff --git a/server/services/githubAccounts.test.js b/server/services/githubAccounts.test.jsindex b5117a31a7..47febbc51d 100644--- a/server/services/githubAccounts.test.js+++ b/server/services/githubAccounts.test.js@@ -16,7 +16,13 @@ vi.mock('./github.js', async (importOriginal) => ({execGh: vi.fn(),}));+vi.mock('./githubNotificationTriage.js', async (importOriginal) => ({+ ...(await importOriginal()),+ retriageOpenThreads: vi.fn(async () => 0),+}));+const { execGh } = await import('./github.js');+const { retriageOpenThreads } = await import('./githubNotificationTriage.js');const { errorMiddleware } = await import('../lib/errorHandler.js');const { default: githubRoutes } = await import('../routes/github.js');@@ -77,6 +83,20 @@ describe('GitHub accounts API', () => {expect(bad.status).toBe(400);});+ it('lets only an Enterprise account trust its whole instance, and re-decides its threads when trust changes', async () => {+ const created = await request(app).post('/api/github/accounts').send({ host: 'github.example.com', trustInstanceUsers: true });+ expect(created.status).toBe(201);+ expect(created.body.trustInstanceUsers).toBe(true);+ expect((await request(app).put('/api/github/accounts/github-com').send({ trustInstanceUsers: true })).status).toBe(400);+ expect((await request(app).post('/api/github/accounts').send({ host: 'github.com', login: 'octocat', trustInstanceUsers: true })).status).toBe(400);++ vi.mocked(retriageOpenThreads).mockClear();+ await request(app).put(`/api/github/accounts/${created.body.id}`).send({ allowAgents: true });+ expect(retriageOpenThreads).not.toHaveBeenCalled();+ await request(app).put(`/api/github/accounts/${created.body.id}`).send({ trustInstanceUsers: false });+ expect(retriageOpenThreads).toHaveBeenCalledWith(created.body.id);+ });+it('rejects hosts and logins that are not plain identifiers', async () => {for (const body of [{ host: '--hostname=evil' },diff --git a/server/services/githubNotificationTriage.js b/server/services/githubNotificationTriage.jsindex af0e5a63c5..ed265a9f5c 100644--- a/server/services/githubNotificationTriage.js+++ b/server/services/githubNotificationTriage.js@@ -28,7 +28,8 @@ const MAX_THREADS_PER_RUN = 60;// changed your own PRs and finished threads (now marked done, not just read);// version 3 leaves a bot's comment on your own PR to the PR workflow; version// 4 finishes a review request on a merged or closed PR; version 5 matches a-// deployment approval to its waiting run. A thread+// deployment approval to its waiting run; version 6 trusts GitHub's own bots+// and, where the account opts in, everyone on an Enterprise instance. A thread// already handed off keeps its hand-off. One an Assist model sorted is not// read again, except your own PR: the rule table decides those, so a verdict// from before the rule existed must not keep one in front of you.@@ -36,16 +37,17 @@ const REDECIDE_SQL = `(state = 'open' AND NOT (evidence ? 'handoff')AND ((reason = 'author' AND subject_type = 'PullRequest' AND trust = 'yours')OR (decision = 'suggest-mark-read' AND COALESCE(evidence->>'rule', '') NOT LIKE 'ai-%')OR (reason = 'review_requested' AND evidence->>'subjectState' IN ('merged', 'closed'))- OR reason = 'approval_requested'))`;+ OR reason = 'approval_requested'+ OR trust = 'outside'))`;// A deployment waiting on you is re-checked every sync: approving or rejecting// it on GitHub does not touch the notification thread.const WAITING_DEPLOYMENT_SQL = "(state = 'open' AND evidence->>'rule' = 'deployment-approval')";-const WAITING_RUNS_JQ = '[.workflow_runs[] | {id, name, displayTitle: .display_title, headBranch: .head_branch, event, actor: .actor.login, createdAt: .created_at, updatedAt: .updated_at}]';+const WAITING_RUNS_JQ = '[.workflow_runs[] | {id, name, displayTitle: .display_title, headBranch: .head_branch, event, actor: .actor.login, actorType: .actor.type, createdAt: .created_at, updatedAt: .updated_at}]';const LOGIN_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,99}(?:\[bot\])?$/;const REPO_RE = /^[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}$/;-const SUBJECT_JQ = '{author: .user.login, association: .author_association, state: .state, merged: (.merged // false)}';-const COMMENT_JQ = '{author: .user.login, association: .author_association, mentions: ([(.body // "") | scan("@[A-Za-z0-9][A-Za-z0-9-]*")] | length)}';+const SUBJECT_JQ = '{author: .user.login, authorType: .user.type, association: .author_association, state: .state, merged: (.merged // false)}';+const COMMENT_JQ = '{author: .user.login, authorType: .user.type, association: .author_association, mentions: ([(.body // "") | scan("@[A-Za-z0-9][A-Za-z0-9-]*")] | length)}';const isBotLogin = (login) => /\[bot\]$/i.test(login);const loginOrNull = (value) => (typeof value === 'string' && LOGIN_RE.test(value) ? value : null);@@ -130,11 +132,14 @@ async function triageThread(row, ctx) {// PR into the trusted lane.const actorLogin = subjectAuthor || loginOrNull(waitingRun?.actor) || commenter;- const trustOf = async (login) => {+ const trustOf = async (login, actorType = null) => {const isOwn = ownLogins.some((own) => own.toLowerCase() === login.toLowerCase());const actorHasWriteAccess = Boolean(!isOwn && repoOwned && repo) && await (await reader.repoTrust(repo)).isTrusted(login);const actorIsOrgMember = Boolean(!isOwn && account.trust === 'private' && repo) && await reader.orgMember(row.repo_owner, login);- return computeThreadTrust({ actorLogin: login, ownLogins, repoOwned, actorHasWriteAccess, actorIsOrgMember, accountTrust: account.trust });+ return computeThreadTrust({+ actorLogin: login, actorType, ownLogins, repoOwned, actorHasWriteAccess, actorIsOrgMember,+ accountTrust: account.trust, trustInstanceUsers: account.trustInstanceUsers === true,+ });};// Any other thread from this repo counts as history, whatever its age: rows// from one sync share a created_at, so an age comparison would see none.@@ -159,7 +164,8 @@ async function triageThread(row, ctx) {}): []);- const trust = actorLogin ? await trustOf(actorLogin) : computeThreadTrust({ actorLogin: null });+ const actorType = subjectAuthor ? subject.authorType : (waitingRun?.actor && actorLogin === loginOrNull(waitingRun.actor) ? waitingRun.actorType : comment?.authorType);+ const trust = actorLogin ? await trustOf(actorLogin, typeof actorType === 'string' ? actorType : null) : computeThreadTrust({ actorLogin: null });const signalSet = new Set(actorLogin? await signalsFor(actorLogin, trust, subjectAuthor ? subject.association : comment?.association, subjectAuthor ? 0 : comment?.mentions ?? 0): []);@@ -170,7 +176,7 @@ async function triageThread(row, ctx) {// A bot (a CI or review app) commenting on your own PR in your repo was// installed there by you, so it is the PR workflow's business, not an// outside reply waiting on you. The repo's collaborator list never names it.- commenterTrust = isBotLogin(commenter) && repoOwned && trust === 'yours' ? 'unknown' : await trustOf(commenter);+ commenterTrust = isBotLogin(commenter) && repoOwned && trust === 'yours' ? 'unknown' : await trustOf(commenter, typeof comment.authorType === 'string' ? comment.authorType : null);for (const signal of await signalsFor(commenter, commenterTrust, comment.association, comment.mentions ?? 0)) signalSet.add(signal);}const signals = [...signalSet];@@ -237,6 +243,16 @@ async function foldCiDuplicates(client, accountId) {}}+/**+ * Re-decide every open thread on the next check, after a change to who the+ * account trusts; the trust a thread was triaged under is otherwise kept until+ * new activity.+ */+export async function retriageOpenThreads(accountId) {+ const { rowCount } = await query("UPDATE github_notifications SET triaged_for = NULL, updated_at = NOW() WHERE account_id = $1 AND state = 'open'", [accountId]);+ return rowCount;+}+/*** Triage this account's threads that are new or have new activity since their* last decision. Returns `{ triaged, decisions: { [decision]: n } }`.diff --git a/server/services/githubNotifications.db.test.js b/server/services/githubNotifications.db.test.jsindex 329ff23484..1bac879e20 100644--- a/server/services/githubNotifications.db.test.js+++ b/server/services/githubNotifications.db.test.js@@ -442,6 +442,15 @@ describe.skipIf(!runDb)('GitHub notifications inbox against Postgres', () => {await expect(reviewDeployment(account.id, '2201', { state: 'rejected', environmentIds: [11] })).rejects.toMatchObject({ code: 'GITHUB_NOTIFICATION_NOT_DEPLOYMENT' });});+ it('treats a Dependabot pull request on your repo as a trusted review, not an outside one', async () => {+ const login = account.login;+ mockGh(() => listing([thread('2301', { owner: login, reason: 'review_requested' })]), {+ [`repos/${login}/hello/pulls/2301`]: { author: 'dependabot[bot]', authorType: 'Bot', association: 'NONE', state: 'open', merged: false },+ });+ await syncAccountNotifications(account.id);+ expect(await getNotification(account.id, '2301')).toMatchObject({ trust: 'trusted', decision: 'suggest-review', suspect: false });+ });+it('sorts undecided threads only in Assist, acts only on trusted ones, and undoes into a learned rule', async () => {const login = account.login;const pr = (author, state = 'open', merged = false) => ({ author, association: 'NONE', state, merged });