Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/e2e/tauri-bridge-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ export const MOCK_RESPONSES: Record<string, unknown> = {
kill_panel: null,
check_git_repo: { isGitRepo: false, branch: null, currentCommit: null },
get_comparison_setup: { prompt: "", workingDir: "", panels: [] },
read_permissions: { allow: [], deny: [], ask: [], tools: { allow: [], deny: [], ask: [] }, paths: { writable: [], readonly: [] }, network: { allowedHosts: [] } },
read_permissions: { allow: [], deny: [], ask: [], tools: { allow: [], deny: [], ask: [] }, paths: { writable: [], readonly: [] }, network: { allowedHosts: [] }, sha256: null },
list_security_presets: [],
list_required_env: [],
list_audit_entries: [],
board_server_check_installed: false,
read_env_config: [],
read_env_config: { entries: [], sha256: null },
get_comparator_analytics: { totalComparisons: 0, totalPanels: 0 },
get_evaluation_session: null,
create_evaluation_session: {
Expand Down
11 changes: 7 additions & 4 deletions apps/desktop/scripts/generate-write-scope.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
import { writeFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { homeWriteScope } from "@harness-kit/core";
import { homeWriteScope, projectWriteScope } from "@harness-kit/core";

const here = dirname(fileURLToPath(import.meta.url));
const out = join(here, "..", "src-tauri", "generated", "write-scope.json");

const scope = Object.fromEntries(
["darwin", "linux", "win32"].map((platform) => {
const scope = Object.fromEntries([
...["darwin", "linux", "win32"].map((platform) => {
const { files, directories } = homeWriteScope(platform);
return [platform, { files: [...files].sort(), directories: [...directories].sort() }];
}),
);
// Project-relative stores: what a granted project root may receive. Same
// derivation as the home lists, so the two cannot drift apart in kind.
["project", (({ files, directories }) => ({ files: [...files].sort(), directories: [...directories].sort() }))(projectWriteScope())],
]);

writeFileSync(out, `${JSON.stringify(scope, null, 2)}\n`);
console.log(`wrote ${out}`);
3 changes: 3 additions & 0 deletions apps/desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tauri-plugin-window-state = "2"
tauri-plugin-dialog = "2"
tauri-plugin-single-instance = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_json = { version = "1", features = ["preserve_order"] }
dirs = "7"
walkdir = "2"
zip = { version = "9.0.5", default-features = false, features = ["deflate"] }
Expand All @@ -35,5 +35,8 @@ rusqlite = { version = "0.40", features = ["bundled"] }
ed25519-dalek = { version = "3", default-features = false }
sha2 = "0.11"

[target.'cfg(target_os = "macos")'.dependencies]
security-framework = "3"

[dev-dependencies]
tempfile = "3"
8 changes: 5 additions & 3 deletions apps/desktop/src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ fn main() {
"read_session_transcript",
// Git
"check_git_repo",
"create_worktrees",
"remove_worktrees",
"get_diff_against_commit",
"check_for_updates",
"trigger_rebuild",
// Evaluation
Expand Down Expand Up @@ -112,6 +109,11 @@ fn main() {
"detect_harnesses",
// Runtime FS scope grants (used by Fleet/Drift's project scope)
"grant_project_scope",
"choose_project_dir",
// Guarded write/rename/remove for the webview's TauriFsProvider
"guarded_write_file",
"guarded_rename_file",
"guarded_remove_file",
// Drift (acknowledgement persistence)
"acknowledge_drift_item",
"unacknowledge_drift_item",
Expand Down
32 changes: 10 additions & 22 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"identifier": "default",
"description": "Default capability — grants core API, read access to harness config roots under $HOME (read-ONLY for the Machine-observation paths: .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot, .agents), and shell spawn for comparator",
"description": "Default capability — grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp-<suffix> files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)",
"windows": ["main"],
"permissions": [
"core:default",
Expand All @@ -10,7 +10,8 @@
"fs:allow-read-text-file",
"fs:allow-read-dir",
"fs:allow-exists",
"fs:allow-write-text-file",
"fs:allow-lstat",
"fs:allow-mkdir",
{
"identifier": "fs:scope",
"allow": [
Expand Down Expand Up @@ -40,7 +41,9 @@
{ "path": "$HOME/.pi" },
{ "path": "$HOME/.pi/**" },
{ "path": "$HOME/.harness-kit" },
{ "path": "$HOME/.harness-kit/**" }
{ "path": "$HOME/.harness-kit/**" },
{ "path": "$HOME/.harness/backups" },
{ "path": "$HOME/.harness/backups/**" }
]
},
{
Expand Down Expand Up @@ -92,23 +95,7 @@
"dialog:allow-open",
"dialog:allow-save",
"shell:default",
"shell:allow-spawn",
"shell:allow-stdin-write",
"shell:allow-kill",
"shell:allow-open",
{
"identifier": "shell:allow-execute",
"allow": [
{ "name": "claude", "cmd": "claude", "args": true },
{ "name": "cursor-agent", "cmd": "cursor-agent", "args": ["--version"] },
{ "name": "copilot", "cmd": "copilot", "args": ["--version"] },
{ "name": "codex", "cmd": "codex", "args": ["--version"] },
{ "name": "opencode", "cmd": "opencode", "args": ["--version"] },
{ "name": "gh", "cmd": "gh", "args": true },
{ "name": "git", "cmd": "git", "args": true },
{ "name": "security", "cmd": "security", "args": true }
]
},
"allow-list-installed-plugins",
"allow-list-marketplaces",
"allow-check-plugin-updates",
Expand Down Expand Up @@ -140,9 +127,6 @@
"allow-compute-live-stats",
"allow-read-session-transcript",
"allow-check-git-repo",
"allow-create-worktrees",
"allow-remove-worktrees",
"allow-get-diff-against-commit",
"allow-check-for-updates",
"allow-trigger-rebuild",
"allow-save-evaluation",
Expand Down Expand Up @@ -204,6 +188,10 @@
"allow-sync-restore-backup",
"allow-detect-harnesses",
"allow-grant-project-scope",
"allow-choose-project-dir",
"allow-guarded-write-file",
"allow-guarded-rename-file",
"allow-guarded-remove-file",
"allow-acknowledge-drift-item",
"allow-unacknowledge-drift-item",
"allow-get-acknowledged-drift-items",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/gen/schemas/capabilities.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capability — grants core API, read access to harness config roots under $HOME (read-ONLY for the Machine-observation paths: .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot, .agents), and shell spawn for comparator","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-write-text-file",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-spawn","shell:allow-stdin-write","shell:allow-kill","shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":true,"cmd":"claude","name":"claude"},{"args":["--version"],"cmd":"cursor-agent","name":"cursor-agent"},{"args":["--version"],"cmd":"copilot","name":"copilot"},{"args":["--version"],"cmd":"codex","name":"codex"},{"args":["--version"],"cmd":"opencode","name":"opencode"},{"args":true,"cmd":"gh","name":"gh"},{"args":true,"cmd":"git","name":"git"},{"args":true,"cmd":"security","name":"security"}]},"allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-scan-claude-config","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-create-worktrees","allow-remove-worktrees","allow-get-diff-against-commit","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}}
{"default":{"identifier":"default","description":"Default capability — grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp-<suffix> files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-lstat","fs:allow-mkdir",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"},{"path":"$HOME/.harness/backups"},{"path":"$HOME/.harness/backups/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-open","allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-scan-claude-config","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-choose-project-dir","allow-guarded-write-file","allow-guarded-rename-file","allow-guarded-remove-file","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}}
Loading
Loading