Skip to content

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

Merge remote-tracking branch 'origin/main' into fix/github-redecide-refused-handoff

Adam Eivy6735673a86a0
diff --cc server/services/githubNotificationTriage.js
index 0f077a2c67,af0e5a63c5..ce1fae47b3
--- a/server/services/githubNotificationTriage.js
+++ b/server/services/githubNotificationTriage.js
@@@ -27,15 -27,20 +27,21 @@@ const MAX_THREADS_PER_RUN = 60
// Open threads a rules-version bump re-decides without new activity: version 2
// 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. A thread
- // handed off keeps its hand-off; one whose hand-off was refused (a Private
- // account without agents) is re-decided like any other. One an Assist model sorted is not
+ // 4 finishes a review request on a merged or closed PR; version 5 matches a
-// deployment approval to its waiting run. A thread
-// already handed off keeps its hand-off. One an Assist model sorted is not
++// deployment approval to its waiting run. A thread handed off keeps its
++// hand-off; one whose hand-off was refused (a Private account without agents)
++// is re-decided like any other. 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.
-const REDECIDE_SQL = `(state = 'open' AND NOT (evidence ? 'handoff')
+const REDECIDE_SQL = `(state = 'open' AND decision IS DISTINCT FROM 'handed-off'
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 = 'review_requested' AND evidence->>'subjectState' IN ('merged', 'closed'))
+ OR reason = 'approval_requested'))`;
+ // 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 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}$/;