Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Merge release updates into browser passkeys

justrache5e54cd83cf5
diff --cc apps/native/electron/main.cjs
index bd0279be,be348302..000cb3e7
--- a/apps/native/electron/main.cjs
+++ b/apps/native/electron/main.cjs
@@@ -68,8 -75,12 +75,13 @@@ process.on('SIGINT', () => app.quit())
app.whenReady().then(async () => {
await require('./shell-path.cjs').restoreShellPath();
+ if (app.isPackaged && !process.env.GRAFF_ELECTRON_SMOKE) {
+ void require('./engine-launcher.cjs').installEngine(path.join(resources, 'graff'), app.getPath('home'))
+ .then(() => require('./mcp-install.cjs').installMcp(path.join(resources, 'graff'), app.getPath('home'), { once: true, version: app.getVersion() }))
+ .catch(error => dialog.showErrorBox('Command setup incomplete', `${error.message}\nRetry from Tools → Install codegraff terminal command.`));
+ }
app.setAccessibilitySupportEnabled(true);
+ const passkeysConfigured = require('./webauthn.cjs').configureWebAuthn(app, resources);
const token = randomBytes(32).toString('hex');
win = createWindow({ width: 1440, height: 920, minWidth: 900, minHeight: 600,
title: 'Codegraff', titleBarStyle: 'hiddenInset', trafficLightPosition: { x: 14, y: 11 }, backgroundColor: '#fafaf9', show: false,
@@@ -167,14 -178,18 +179,20 @@@
['Toggle terminal', 'CmdOrCtrl+J', 'terminal'], ['Open workspace…', 'CmdOrCtrl+O', 'workspace'], ['Split right', 'CmdOrCtrl+D', 'split-right'],
['Split down', 'CmdOrCtrl+Shift+D', 'split-down'], ['Zoom split', 'CmdOrCtrl+Shift+Enter', 'split-zoom'],
].map(([label, accelerator, action]) => ({ label, accelerator, click: () => win.webContents.send('desktop-action', action) })) },
- { label: 'Tools', submenu: [{ label: 'Install codegraff terminal command…', enabled: app.isPackaged && process.platform === 'darwin', click: async () => {
+ { label: 'Tools', submenu: [{ label: 'Configure MCP clients…', enabled: app.isPackaged, click: async () => {
+ try {
+ const detail = await require('./mcp-install.cjs').installMcp(path.join(resources, 'graff'), app.getPath('home'));
+ await dialog.showMessageBox(win, { message: 'MCP clients configured', detail });
+ } catch (error) { dialog.showErrorBox('MCP setup', error.message); }
+ } }, { label: 'Install codegraff terminal command…', enabled: app.isPackaged && process.platform === 'darwin', click: async () => {
try {
+ await require('./engine-launcher.cjs').installEngine(path.join(resources, 'graff'), app.getPath('home'));
const installed = await require('./cli-launcher.cjs').installLauncher(path.resolve(app.getPath('exe'), '../../..'), app.getPath('home'));
- await dialog.showMessageBox(win, { message: 'Terminal command installed', detail: `Run codegraff . to open a project here. Ensure ${path.dirname(installed)} is on your PATH.` });
+ await dialog.showMessageBox(win, { message: 'Terminal command installed', detail: `Run graff for the CLI or codegraff . for the GUI. Open a new terminal to load the PATH update (${path.dirname(installed)}).` });
} catch (error) { dialog.showErrorBox('Terminal command', error.message); }
- } }] },
+ } }, { label: 'Browser passkey help…', click: () => void require('./webauthn.cjs').showPasskeyHelp({
+ window: win, browser, dialog, shell: require('electron').shell, configured: passkeysConfigured,
+ }).catch(() => dialog.showErrorBox('Browser passkeys', 'Could not open the default browser. Use another sign-in method on the site.')) }] },
{ role: 'editMenu' }, { label: 'View', submenu: [{ role: 'reload' }, { role: 'toggleDevTools' }, { role: 'togglefullscreen' }, { label: 'Release browser pages', click: () => { browser.closeAll(); win.webContents.send('browser-event', { type: 'released' }); } }] },
{ label: 'Performance', submenu: [
{ label: 'Start recording', click: () => void profiler.start() },
diff --cc apps/native/electron/smoke-launch.cjs
index 144fff91,728ce096..5d4a5f5e
--- a/apps/native/electron/smoke-launch.cjs
+++ b/apps/native/electron/smoke-launch.cjs
@@@ -26,9 -26,9 +26,10 @@@ async function run({ win, backend, brow
const version = execFileSync(path.join(resources, 'graff'), ['--version'], { encoding: 'utf8', timeout: 10000 }).trim().split('\n')[0];
assert.match(version, /graff/i);
if (process.env.GRAFF_SMOKE_HTML_TOOL) await require('./smoke-html.cjs').run({ win, backend, token });
- const report = { passed: ['bundled server', 'production composer', 'empty browser lifecycle', 'request authentication', 'native module ABI', 'bundled engine executable', 'packaged executable'], version };
+ if (process.env.GRAFF_SMOKE_TITLES) await require('./smoke-titles.cjs').run({ win, backend });
+ const report = { appVersion: app.getVersion(), passed: ['bundled server', 'production composer', 'empty browser lifecycle', 'request authentication', 'native module ABI', 'bundled engine executable', 'packaged executable'], version };
+ if (process.env.GRAFF_SMOKE_WEBAUTHN) report.passed.push(await require('./smoke-webauthn.cjs').run({ browser, backend, resources }));
fs.writeFileSync(process.env.GRAFF_ELECTRON_SMOKE, JSON.stringify(report, null, 2));
- console.log(process.env.GRAFF_SMOKE_HTML_TOOL ? 'Packaged launch and offline HTML tool checks passed.' : 'Packaged launch checks passed. No prompt sent or coding setting changed.');
+ console.log(process.env.GRAFF_SMOKE_TITLES ? 'Packaged title checks passed.' : process.env.GRAFF_SMOKE_HTML_TOOL ? 'Packaged launch and offline HTML tool checks passed.' : 'Packaged launch checks passed. No prompt sent or coding setting changed.');
}
module.exports = { run };
diff --cc apps/native/package.json
index 38413d1e,f167e85c..b6f29f88
--- a/apps/native/package.json
+++ b/apps/native/package.json
@@@ -13,8 -13,8 +13,9 @@@
"test": "node --experimental-strip-types --test lib/cite-markup.test.ts lib/graff-events.test.ts lib/acp.test.ts lib/sessions.test.ts lib/session-store.test.ts lib/follow-scroll.test.ts lib/prompt-queue.test.ts lib/prompt-queue-steer.test.ts lib/prompt-queue-resume.test.ts lib/agents.test.ts lib/mermaid-plugin.test.ts lib/prompt-history.test.ts lib/attachments.test.ts lib/workspaces.test.ts lib/fuzzy.test.ts lib/folder-picker.test.ts lib/browser/annotations.test.ts lib/browser/url.test.ts components/site/harness-split.test.ts",
"electron:build": "bash electron/build.sh",
"test:electron": "bun test electron/policy.test.cjs",
+ "test:webauthn": "node scripts/test-webauthn.mjs",
"test:desktop": "bun test lib ./electron/*.test.cjs",
+ "test:session-navigation": "GRAFF_VISUAL_SUITE=session-navigation bun scripts/test-visual.mjs",
"test:tab-drag": "GRAFF_VISUAL_SUITE=tab-drag bun scripts/test-visual.mjs",
"test:turns": "GRAFF_VISUAL_SUITE=turns bun scripts/test-visual.mjs",
"test:visual": "bun scripts/test-visual.mjs",
diff --cc docs/adr/0132-desktop-passkeys-use-signed-device-credentials.md
index f9b4c466,00000000..9b935196
mode 100644,000000..100644
--- a/docs/adr/0132-desktop-passkeys-use-signed-device-credentials.md
+++ b/docs/adr/0132-desktop-passkeys-use-signed-device-credentials.md
@@@ -1,46 -1,0 +1,46 @@@
- # 0115. Desktop passkeys use signed device credentials
++# 0132. Desktop passkeys use signed device credentials
+
+Status: accepted
+
+## Context
+
+The embedded browser did not configure Electron's macOS WebAuthn authenticator.
+Platform requests therefore had no Touch ID integration, and signing supplied
+no credential keychain group. The pinned Electron API supports Secure Enclave
+credentials, not access to existing iCloud Keychain passkeys. Configuring it is
+not sufficient evidence that every stalled sign-in is fixed.
+
+## Decision
+
+The distribution signer derives one credential group from the signing team and
+actual bundle identifier, puts it in the main application's keychain entitlement,
+and writes the identical value to a signed resource. Startup configures Touch ID
+from that resource before browser creation. Development builds without it leave
+the authenticator disabled rather than inventing a signing identity.
+
+The signer requires and embeds a macOS provisioning profile authorizing the
+team, application identifier, and credential group, and includes the authorized
+application identifier in the main app's entitlements. A stale embedded profile
+is replaced, not silently retained. Supplying a keychain entitlement alone can
+pass `codesign --verify` while macOS refuses launch for lack of a matching
+profile; the build must not mistake signature integrity for authorization.
+
+The persistent browser session handles account selection through a parented
+native dialog. Only the visible owned browser page can prompt; cancellation,
+navigation, hiding, and destruction fail closed. No credential is silently chosen.
+The existing sandbox and general permission denial remain unchanged.
+
+An explicit Tools menu action explains device-bound credentials and offers to
+open the active web page in the default browser. It never automatically forwards
+a failed authentication request or implies that external login transfers a
+session back to Codegraff. We do not enable a different provider API or claim
+third-party iCloud credentials are accessible.
+
+## Consequences
+
+Signing team, bundle identifier, and browser partition must remain stable to
+retain credential access. Unsupported credentials still need another sign-in
+method. Automated virtual-authenticator checks establish request dispatch and
+selection behavior, not biometric or keychain access. Release support requires
+registration, persistence, authentication, and cancellation validation in the
+Developer ID-signed application on supported hardware.
diff --cc docs/adr/README.md
index 018215b1,b7ce84c5..f6cd99d9
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -126,6 -125,30 +125,31 @@@ record only when you need the evidence
| [0112](0112-mcp-wire-names-preserve-raw-routing.md) | MCP wire names are escaped and bounded; raw server/tool identities control policy and dispatch. |
| [0113](0113-clipboard-errors-need-evidence.md) | Direct AppKit clipboard failures need typed evidence; generic helper failures never imply Automation permission. |
| [0114](0114-live-citations-are-terminal-presentation.md) | Live terminal citations use per-stream display filters with independent reasoning state; structured JSON/ACP output stays unchanged. |
+ | [0116](0116-informational-turns-have-bounded-scope.md) | Summary turns gather bounded evidence; coding completion requirements apply to requested changes. |
+ | [0118](0118-file-edits-check-target-worktree.md) | File edits checkpoint the target Git worktree; unresolved paths retain the caller checkpoint. |
+ | [0119](0119-computer-tools-receive-caller-context.md) | Computer-use MCP requests receive opaque caller-owned session and turn context. |
+ | [0120](0120-draft-publication-does-not-complete-verification.md) | Draft PRs cannot satisfy verified completion; only a user control scoped to this conversation and goal permits an unverified draft handoff. |
+ | [0121](0121-claims-include-repository-identity.md) | Claims include repository identity; literal PR mutations compare the observed repository, PR number and branch, while unknown scopes stay conservative. |
+
+ | [0122](0122-one-session-navigation-surface.md) | Open chats use the expanded sidebar or collapsed top tabs, preserving drafts and groups; focused mode keeps a compact composer and accessible settings. |
+
+ | [0123](0123-pr-check-observations-retain-the-rollup.md) | PR completion retains named current-head check observations locally; diagnostic receipts never replace fresh verification. |
+
+ | [0124](0124-review-checkpoints-preserve-unfinished-scope.md) | Explicit reviews request a findings checkpoint every twenty calls without forcing completion or changing authority. |
+
+ | [0125](0125-review-deadlines-belong-to-one-turn.md) | Opt-in review deadlines use joined turn-owned watchers, preserve user cancellation, and cannot validate late results. |
+
+ | [0126](0126-publication-retains-observed-check-failures.md) | Observed failed checks survive resumes; non-draft publication waits for successful reruns and occupies its own tool batch. |
+
+
+ | [0127](0127-title-generation-is-an-explicit-result.md) | GUI titles require one explicit result and successful process exit; diagnostics never become chat names. |
+
+ | [0128](0128-gui-context-meter-uses-harness-occupancy.md) | The GUI context ring uses last-reported harness occupancy; missing usage stays unknown. |
+
+ | [0129](0129-mcp-server-delegates-bounded-cli-tasks.md) | `graff mcp serve` exposes bounded fresh CLI tasks over stdio; launch-time permissions and workspace stay outside tool arguments. |
+ | [0130](0130-mcp-task-app-is-an-optional-result-view.md) | MCP task apps negotiate presentation only; structured results and text fallback share the same bounded task execution. |
+ | [0131](0131-mcp-http-and-managed-client-registration.md) | HTTP MCP shares bounded task execution; CLI and GUI installs register detected clients additively through a private local service. |
++| [0132](0132-desktop-passkeys-use-signed-device-credentials.md) | Desktop Touch ID uses matching signed keychain configuration; account choice is explicit and existing iCloud credentials need a fallback. |
## When to write one