Skip to content

Add diagnostics center, writable PR review, notification actions, setup-script editor, and prompt library - #467

Merged
SergeSerb2 merged 10 commits into
mainfrom
surgecode/next-features
Aug 4, 2026
Merged

Add diagnostics center, writable PR review, notification actions, setup-script editor, and prompt library#467
SergeSerb2 merged 10 commits into
mainfrom
surgecode/next-features

Conversation

@SergeSerb2

Copy link
Copy Markdown
Owner

Summary

Implements the five feature picks from the Recommended next (2026-08-03) section landed by #464 in docs/project/macos-top-100-missing-features.md, at their smallest independently shippable slices. The UI/UX audit's list is deliberately untouched, per request.

  • Diagnostics, process & log center (ranks 17/91/92) — the Mac now consumes the four server diagnostics RPCs that had no client. New Diagnostics settings tab: process tree with confirmed SIGINT/SIGKILL controls, per-process CPU/memory history windows, a trace/log console with copyable warning+error events, and an observability section (logs dir, OTLP state). The Connection tab gains a mode-aware diagnostic checklist (descriptor → auth session → server version → WebSocket) that names a concrete fix per failure.
  • Writable PR review (rank 11) — new review.replyToThread, review.resolveThread, and review.submitReview RPCs (contracts + server, GitHub-only like the read side, gated on the pre-existing review:write scope; commit id resolved server-side). The native review sheet grows per-thread reply editors, resolve/reopen buttons, and a Comment/Approve/Request-changes composer; mutations serialize behind an in-flight guard and refetch on success.
  • Actionable notifications (rank 76) — approval notifications now carry Approve/Deny UNNotificationActions and the request id; action taps flow through a pure policy mapping into the existing id-based approval response path. Stale requests select the affected thread and surface the error instead of failing silently; approval banners are keyed by request id so concurrent approvals on one thread no longer replace each other.
  • Project setup-script editor (rank 39) — "Project Settings…" sheet from the sidebar project menu: create/edit/reorder/delete scripts (name, command, icon, runOnWorktreeCreate, preview URL/auto-open), saved whole-list through the existing project.meta.update path. The UI model finally carries the preview fields the wire model always had; the command palette shares the hoisted icon mapping.
  • Prompt library + composer mentions (ranks 23/24) — new promptLibrary contracts schema on ServerSettings (global + per-project prompts, whole-object patch replacement, backward-compatible decoding defaults). Mac: Prompts settings tab (CRUD, favorite, insert-into-composer, copy body) synced via settingsUpdated, and a $ completion source in the composer ranking enabled provider skills ahead of library prompts (favorites first), inserting the skill name or prompt body.

Known follow-ups left in the backlog: inline line-anchored PR comments + non-GitHub review providers; Stop/Snooze/Answer notification actions; log-file tailing RPC for the console; prompt parameterization/version history/run-in-new-thread; script timeout/env fields (no contract support yet).

Design notes (per the audit's spec requirement)

Feature Owner Remote-device behavior Offline/reconnect Permissions Streaming/pagination
Diagnostics center Server (read/signal RPCs), Mac renders Remote Mac: RPCs run against the connected host, wizard targets device URL Read-only; errors render inline, no caching orchestration:read (reads), orchestration:operate (signal); server refuses non-descendant pids Bounded snapshots; history windowed (5/15/60 min)
Writable PR review Server (gh CLI), Mac UI Same code path per connected host No offline queue; failure surfaces inline + global error path review:write scope Void mutations + snapshot refetch (existing truncated snapshot semantics)
Notification actions Mac client Per-device AppModel resolved from the payload's device id Stale request → select thread + report; no retry queue Uses existing approval response path (no new scope) N/A
Setup-script editor Server persists (project.meta.update), Mac edits Works for remote projects via the same bridge Optimistic local apply; save error stays in the sheet orchestration:write (existing) Whole-list replace (bounded by project script count)
Prompt library Server settings store, Mac edits Settings already sync per host; settingsUpdated refreshes peers Optimistic apply; failure reports and keeps prior state Existing settings RPC auth Whole-config patch (bounded by library size)

Area

  • apps/mac — native macOS app
  • apps/windows — Windows desktop app
  • apps/mobile — iPhone companion app
  • apps/server — backend server
  • Shared packages (packages/contracts, packages/shared, packages/client-runtime, …) or relay (infra/relay)
  • Build, CI, or release tooling
  • Docs

Release size

  • size:XS — tiny internal, documentation, or narrowly scoped fix
  • size:S — small user-visible fix or contained improvement
  • size:M — normal feature or meaningful behavior change
  • size:L — broad feature or substantial cross-package change
  • size:XL — release-system, architecture, or ecosystem-scale change

Verification

  • pnpm run verify --all passes (check + typecheck + tests; adds lint:mobile and the Swift suite)
  • pnpm run test:mac passes (required for apps/mac changes)
  • Manually verified (describe below)

pnpm run verify --all green end-to-end: vp check 0 errors, typecheck clean across 13 packages, 209 TS test files / 1935 tests passing, full Swift suite passing (1178 tests incl. the new suites: diagnostics RPC coding + presentation + connection checklist, review RPC coding + mutation flow, notification action mapping + approval responses, project-script editor + palette reflection, prompt library coding + composer $ suggestions), lint:mobile clean. One rerun was needed for a settings-tab count guard and one for load-flaked server.test.ts cases (111/111 pass in isolation); neither touched the shipped code. New UI was exercised through swift-testing suites and the registered UIProbe snapshot; the app was not run manually.

Screenshots / Recordings

Not captured — built and verified headlessly via the test suites; happy to attach captures on request.

Release notes

Adds a diagnostics/process/log center with a connection checklist, writable GitHub PR review, Approve/Deny notification actions, a project setup-script editor, and a prompt library with composer $ mentions to the macOS app.

Add review.replyToThread, review.resolveThread, and review.submitReview
RPCs (gated on the existing review:write scope) so clients can reply to
review threads, resolve/reopen them, and submit APPROVE/COMMENT/
REQUEST_CHANGES reviews without leaving the app. GitHub-only, matching
the read side; other providers keep the standard fallback error.

Refs: docs/project/macos-top-100-missing-features.md rank 11
Persist a prompt library (global + per-project prompts with optional
description and favorite flag) on ServerSettings so storage, transport,
redaction, and the settingsUpdated stream come for free. Whole-object
patch replacement matches customInstructions; pre-existing settings
files decode via the same withDecodingDefault pattern.

Refs: docs/project/macos-top-100-missing-features.md rank 23
Register an agent.approval UNNotificationCategory with Approve and Deny
actions, carry the approval request id in the notification payload, and
route action taps through a pure policy mapping into the existing
id-based approval response path. Stale requests select the affected
thread and surface the error instead of failing silently. Approval
banners are now keyed by request id so concurrent approvals on one
thread no longer replace each other.

Refs: docs/project/macos-top-100-missing-features.md rank 76
Add a Project Settings sheet from the sidebar project context menu that
creates, edits, reorders, and deletes project scripts (name, command,
icon, runOnWorktreeCreate, preview URL/auto-open) and persists the full
list through the existing project.meta.update path. The UI model now
carries the preview fields the wire model always had, and the command
palette shares the hoisted icon-to-symbol mapping.

Refs: docs/project/macos-top-100-missing-features.md rank 39
Consume the four server diagnostics RPCs (trace diagnostics, process
tree, resource history, process signaling) that previously had no Mac
client. Add a Diagnostics settings tab with a process table and
confirmed SIGINT/SIGKILL controls, per-process CPU/memory history, a
trace/log console with copyable warning and error events, and an
observability section. Extend the Connection tab with a mode-aware
diagnostic checklist (descriptor, auth session, server version,
WebSocket) that names a concrete fix per failure.

Refs: docs/project/macos-top-100-missing-features.md ranks 17, 91, 92
Wire the new review.replyToThread, review.resolveThread, and
review.submitReview RPCs into the native review sheet: per-thread reply
editor, resolve/reopen button, and a review composer with Comment,
Approve, and Request changes submission. Mutations serialize behind an
in-flight guard, surface errors inline and through the global error
path, and refetch the snapshot on success.

Refs: docs/project/macos-top-100-missing-features.md rank 11
Decode and sync the new promptLibrary server settings, add a Prompts
settings tab for global and per-project prompts (create, edit,
favorite, delete, insert into composer, copy body), and add a $
completion source to the composer that ranks enabled provider skills
ahead of library prompts (favorites first) and inserts the skill name
or prompt body. Also place the Diagnostics tab in the settings sidebar
so it is navigable.

Refs: docs/project/macos-top-100-missing-features.md ranks 23, 24
@SergeSerb2 SergeSerb2 added the size:XL Release-system, architecture, or ecosystem-scale change label Aug 4, 2026
@SergeSerb2

Copy link
Copy Markdown
Owner Author

@SurgeCode

@SergeSerb2 SergeSerb2 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature-rich PR adding diagnostics center, writable PR review, notification actions, prompt library, and project-settings editor. Code is well-structured with solid error handling and testability; needs verification that two field declarations (pendingDecisionResponseIDs, skills) are present in the actual file.

Could not anchor

  • important apps/mac/Sources/SurgeCodeMac/Model/AppModel.swift:3519 — respondToApproval uses pendingDecisionResponseIDs as a Set to track in-flight responses, but its declaration doesn't appear in the visible diff. If this is a new property being added in this PR, its declaration line must appear as a + line somewhere in the AppModel changes. Verify it's declared at the top of the class (e.g., private var pendingDecisionResponseIDs = Set<String>()), or this will fail to compile.

SurgeCode auto-review · model=codex/gpt-5.6-luna · head=ea6315ea0487

Comment thread apps/mac/Sources/SurgeCodeMac/Model/AppModel.swift
@SergeSerb2

Copy link
Copy Markdown
Owner Author

Review follow-up for the unanchored pendingDecisionResponseIDs finding: confirmed the declaration already exists near the top of AppModel.swift (public private(set) var pendingDecisionResponseIDs: Set = []) and is present on the PR base, so it is intentionally not a new + line in this PR. respondToApproval and the user-input response path use the same set safely. The relevant macOS build and RendererSidebarContractTests pass; no source change was needed for this verification finding.

@SergeSerb2
SergeSerb2 merged commit e61f8ec into main Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Release-system, architecture, or ecosystem-scale change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant