Skip to content

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

Python

hotfix: stamp packaged Codegraff.app as com.codegraff.app

justrach95015c0e5909
diff --git a/AGENTS.md b/AGENTS.md
index 70cfb405..bdf2e510 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -14,8 +14,10 @@ their edit histories are visible to everyone.
text, the root cause in code terms, and the fix. Evidence stays in the
conversation, not the tracker. Same for PR bodies and commit messages.
- **No assistant or model-vendor attribution anywhere** — not in issues, PRs,
- commit messages, or trailers (no `Co-Authored-By`, no session links). Commits
- carry only the repository owner's git identity.
+ commit messages, or trailers. No OpenAI/Anthropic/Cursor/session links. Commits
+ still use the repository owner's git identity as Author. When graff makes the
+ commit, `Co-Authored-By: Codegraff <[email protected]>` is allowed
+ (and is the only allowed trailer). Omit it if the user says not to.
- **If something sensitive was already posted, delete it** (`gh api graphql`
`deleteIssue` with the node id from `gh issue view N --json id`); editing is
not enough because edit history stays visible. Then tell the user what was
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1afa5e96..edfd6e42 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -54,6 +54,11 @@ current is part of cutting a release.
unattended session unless the machine was started with `--yolo`.
`docs/remote-control.md`, `docs/remote-control-security.md`.
+## v0.0.302
+
+- Packaged `Codegraff.app` uses `com.codegraff.app`. A `dev.*` bundle ID fails the desktop tests and `distribute.sh` (ADR 0143).
+- Graff commits may include `Co-Authored-By: Codegraff <[email protected]>`; vendor attribution stays banned.
+
## v0.0.299
- The MCP `run_task` result view uses the codegraff.com paper palette (paper, rice, ink, coral, cobalt, gold) instead of the desktop emerald chrome. Host light/dark still applies. No webfonts.
diff --git a/CLAUDE.md b/CLAUDE.md
index 26dd5623..5700213e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -8,5 +8,5 @@ This repository is **public**. Issues, pull requests, commits, comments, and the
- **Never post internal details.** No private-repo paths or links (website, frontend, gateway, zigrepper), no asset or deploy names, no infrastructure or performance numbers, no session/run ids, no trace or transcript excerpts, no local paths (`~/…`), no quoted user messages, no provider/model/account details. Nothing from `.graff/` traces, sessions, or tool results.
- **An issue is the bare minimum**: a generic symptom, the harness's own error text, the root cause in code terms, and the fix. Evidence stays in the conversation, not the tracker. Same for PR bodies and commit messages.
-- **No assistant or model-vendor attribution anywhere** — not in issues, PRs, commit messages, or trailers (no `Co-Authored-By`, no session links). Commits carry only the repository owner's git identity.
+- **No assistant or model-vendor attribution anywhere** — not in issues, PRs, commit messages, or trailers. No OpenAI/Anthropic/Cursor/session links. Commits still use the repository owner's git identity as Author. When graff makes the commit, `Co-Authored-By: Codegraff <[email protected]>` is allowed (and is the only allowed trailer). Omit it if the user says not to.
- **If something sensitive was already posted, delete it** (`gh api graphql` `deleteIssue` with the issue's node id from `gh issue view N --json id`); editing is not enough because edit history stays visible. Then tell the user what was exposed and for how long.
diff --git a/apps/native/electron/build.sh b/apps/native/electron/build.sh
index 0022a294..09b3f77a 100644
--- a/apps/native/electron/build.sh
+++ b/apps/native/electron/build.sh
@@ -6,7 +6,7 @@ version="${GRAFF_VERSION:-0.0.291}"
ui="$root/apps/native"
out="$root/zig-out/electron"
app_name="Codegraff"
-bundle_id="dev.codegraff.electron.local"
+bundle_id="com.codegraff.app"
if [[ "${GRAFF_DEV:-0}" == "1" ]]; then
out="$root/zig-out/electron-dev"
app_name="Codegraff Dev"
diff --git a/apps/native/electron/distribute.sh b/apps/native/electron/distribute.sh
index db69ac84..addec0ad 100755
--- a/apps/native/electron/distribute.sh
+++ b/apps/native/electron/distribute.sh
@@ -16,6 +16,7 @@ work="$(mktemp -d "${TMPDIR:-/tmp}/graff-distribute.XXXXXX")"
cleanup() { rm -rf "$work"; }
trap cleanup EXIT
ditto "$source_app" "$app"
+bun "$here/release-identity.cjs" "$app"
version="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$app/Contents/Info.plist")"
# Desktop stays 3-part while the CLI accepts 4-part hotfixes (0.0.300.1):
# electron-updater compares the feed as semver and the notarization chain is
diff --git a/apps/native/electron/publish-updates.sh b/apps/native/electron/publish-updates.sh
index 341302b4..79d57fc3 100644
--- a/apps/native/electron/publish-updates.sh
+++ b/apps/native/electron/publish-updates.sh
@@ -5,6 +5,7 @@ here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
tag="${1:?Usage: publish-updates.sh vVERSION distribution-directory}"
out="${2:?Provide the notarized distribution directory}"
repo=justrach/codegraff
+bun "$here/release-identity.cjs" "$out/Codegraff.app"
codesign --verify --deep --strict "$out/Codegraff.app"
xcrun stapler validate "$out/Codegraff.app"
xcrun stapler validate "$out/Codegraff-macos-arm64.dmg"
diff --git a/apps/native/electron/release-identity.cjs b/apps/native/electron/release-identity.cjs
new file mode 100644
index 00000000..155803d6
--- /dev/null
+++ b/apps/native/electron/release-identity.cjs
@@ -0,0 +1,53 @@
+'use strict';
+
+const { execFileSync } = require('node:child_process');
+const fs = require('node:fs');
+const path = require('node:path');
+
+/** Packaged / notarized Codegraff.app. Never a `dev.*` identifier. */
+const RELEASE_BUNDLE_ID = 'com.codegraff.app';
+/** GRAFF_DEV=1 local rebuild only. */
+const DEV_BUNDLE_ID = 'dev.codegraff.app';
+
+function assertReleaseBundleId(id) {
+ if (typeof id !== 'string' || id.length === 0) {
+ throw new Error('Release CFBundleIdentifier is missing.');
+ }
+ if (id.startsWith('dev.')) {
+ throw new Error(`Release CFBundleIdentifier must not be a dev identity (got ${id}).`);
+ }
+ if (id !== RELEASE_BUNDLE_ID) {
+ throw new Error(`Release CFBundleIdentifier must be ${RELEASE_BUNDLE_ID}, got ${id}.`);
+ }
+}
+
+function readBundleId(app) {
+ const plist = path.join(app, 'Contents', 'Info.plist');
+ try {
+ return execFileSync('/usr/libexec/PlistBuddy', ['-c', 'Print :CFBundleIdentifier', plist], {
+ encoding: 'utf8',
+ stdio: ['ignore', 'pipe', 'pipe'],
+ }).replace(/\r?\n$/, '');
+ } catch {
+ const text = fs.readFileSync(plist, 'utf8');
+ const match = text.match(/<key>CFBundleIdentifier<\/key>\s*<string>([^<]+)<\/string>/);
+ if (!match) throw new Error(`CFBundleIdentifier missing in ${plist}`);
+ return match[1];
+ }
+}
+
+function assertReleaseApp(app) {
+ if (!app) throw new Error('Usage: release-identity.cjs /path/Codegraff.app');
+ assertReleaseBundleId(readBundleId(app));
+}
+
+module.exports = { RELEASE_BUNDLE_ID, DEV_BUNDLE_ID, assertReleaseBundleId, readBundleId, assertReleaseApp };
+
+if (require.main === module) {
+ try {
+ assertReleaseApp(process.argv[2]);
+ } catch (error) {
+ console.error(error instanceof Error ? error.message : error);
+ process.exit(1);
+ }
+}
diff --git a/apps/native/electron/release-identity.test.cjs b/apps/native/electron/release-identity.test.cjs
new file mode 100644
index 00000000..e33497c9
--- /dev/null
+++ b/apps/native/electron/release-identity.test.cjs
@@ -0,0 +1,65 @@
+'use strict';
+
+const { test } = require('node:test');
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const os = require('node:os');
+const path = require('node:path');
+const { spawnSync } = require('node:child_process');
+const {
+ RELEASE_BUNDLE_ID,
+ DEV_BUNDLE_ID,
+ assertReleaseBundleId,
+ assertReleaseApp,
+} = require('./release-identity.cjs');
+
+test('release desktop identity is com.codegraff.app, not a dev build', () => {
+ assert.equal(RELEASE_BUNDLE_ID, 'com.codegraff.app');
+ assert.equal(DEV_BUNDLE_ID, 'dev.codegraff.app');
+ assert.notEqual(RELEASE_BUNDLE_ID, DEV_BUNDLE_ID);
+ assert.ok(!RELEASE_BUNDLE_ID.startsWith('dev.'));
+ assert.ok(DEV_BUNDLE_ID.startsWith('dev.'));
+ assert.doesNotThrow(() => assertReleaseBundleId(RELEASE_BUNDLE_ID));
+ assert.throws(() => assertReleaseBundleId('dev.codegraff.electron.local'), /dev identity/);
+ assert.throws(() => assertReleaseBundleId(DEV_BUNDLE_ID), /dev identity/);
+ assert.throws(() => assertReleaseBundleId('org.example.app'), /must be com\.codegraff\.app/);
+});
+
+test('build.sh stamps the release id unless GRAFF_DEV is set', () => {
+ const src = fs.readFileSync(path.join(__dirname, 'build.sh'), 'utf8');
+ assert.match(src, /^bundle_id="com\.codegraff\.app"$/m);
+ assert.match(src, /GRAFF_DEV[\s\S]*bundle_id="dev\.codegraff\.app"/);
+ assert.doesNotMatch(src, /electron\.local/);
+ assert.doesNotMatch(src, /^GRAFF_DEV=1/m);
+});
+
+test('distribute and publish refuse a packaged app that is not the release identity', () => {
+ const distribute = fs.readFileSync(path.join(__dirname, 'distribute.sh'), 'utf8');
+ const publish = fs.readFileSync(path.join(__dirname, 'publish-updates.sh'), 'utf8');
+ assert.match(distribute, /release-identity\.cjs/);
+ assert.match(publish, /release-identity\.cjs/);
+});
+
+test('assertReleaseApp accepts only the release identifier', () => {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'graff-identity-'));
+ const write = (id) => {
+ const app = path.join(root, `${id.replace(/\./g, '-')}.app`);
+ fs.mkdirSync(path.join(app, 'Contents'), { recursive: true });
+ fs.writeFileSync(
+ path.join(app, 'Contents', 'Info.plist'),
+ `<?xml version="1.0"?><plist><dict><key>CFBundleIdentifier</key><string>${id}</string></dict></plist>\n`,
+ );
+ return app;
+ };
+ try {
+ assert.doesNotThrow(() => assertReleaseApp(write(RELEASE_BUNDLE_ID)));
+ assert.throws(() => assertReleaseApp(write('dev.codegraff.electron.local')), /dev identity/);
+ const rejected = spawnSync(process.execPath, [path.join(__dirname, 'release-identity.cjs'), write(DEV_BUNDLE_ID)], {
+ encoding: 'utf8',
+ });
+ assert.notEqual(rejected.status, 0);
+ assert.match(rejected.stderr, /dev identity/);
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
diff --git a/docs/adr/0143-release-desktop-is-com-codegraff-app.md b/docs/adr/0143-release-desktop-is-com-codegraff-app.md
new file mode 100644
index 00000000..2abec12b
--- /dev/null
+++ b/docs/adr/0143-release-desktop-is-com-codegraff-app.md
@@ -0,0 +1,28 @@
+# 0143. Packaged Codegraff.app is com.codegraff.app
+
+Status: accepted 2026-09-20
+
+## Context
+
+`apps/native/electron/build.sh` stamped the Electron trial identifier
+`dev.codegraff.electron.local` onto every non-`GRAFF_DEV` build. That ID
+shipped in `/Applications/Codegraff.app`. macOS TCC and the single-instance
+lock then treated a production install as a development bundle. ADR 0132
+says the release identifier must stay stable; the leaked `dev.*` value was
+not that identifier.
+
+## Decision
+
+A packaged, notarized `Codegraff.app` uses `CFBundleIdentifier`
+`com.codegraff.app`. `GRAFF_DEV=1` remains `dev.codegraff.app` with a
+separate Electron user-data directory. `distribute.sh` and
+`publish-updates.sh` refuse any other identifier. Unit tests fail if
+`build.sh` defaults to a `dev.*` id or still contains `electron.local`.
+
+## Consequences
+
+The next signed build is a new macOS identity: TCC grants from
+`dev.codegraff.electron.local` do not carry over. Old and new copies can
+run side by side until the previous app is replaced. Release signing is
+Developer ID + notarization; this identity change does not add a
+provisioning-profile step.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index d817c473..191c0f5f 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -162,6 +162,7 @@ record only when you need the evidence or the edge cases.
| [0140](0140-rlm-is-listed-when-available.md) | `rlm` is on the catalog whenever it is available. No batch-size or compactAt gate. `--old` still hides it. |
| [0141](0141-observer-notch-is-a-nonactivating-panel.md) | The desktop session observer is a non-activating SwiftUI edge panel; cells are live ACP work, opt-in from Settings. |
| [0142](0142-zigzag-is-not-a-frontend.md) | Zigzag is not a frontend. TTY `graff repl` is `TUI/`; piped/CI uses a local scripted Model. Do not vendor zigzag. |
+| [0143](0143-release-desktop-is-com-codegraff-app.md) | Packaged Codegraff.app is `com.codegraff.app`. `dev.*` identities are local rebuilds only. |
## When to write one
diff --git a/docs/adr/dev-desktop-identity.md b/docs/adr/dev-desktop-identity.md
index 25976b26..7a2643d3 100644
--- a/docs/adr/dev-desktop-identity.md
+++ b/docs/adr/dev-desktop-identity.md
@@ -15,7 +15,8 @@ of opening a development desktop, preventing side-by-side testing.
A bundled development marker selects the name `Codegraff Dev` and a separate
Electron user-data directory before acquiring the single-instance lock.
`scripts/build_and_run.sh` builds and launches this variant by default and only
-stops this checkout's previous dev process. The release build remains unchanged.
+stops this checkout's previous dev process. The packaged release is
+`com.codegraff.app` (ADR 0143).
Development startup does not automatically configure external MCP clients, and
its menus cannot replace the installed terminal launcher or MCP service. It has