Repository navigation
fix: env refs for Cursor/VS Code, one profile path, drafts survive quit, distinct secret names - #471
Merged
Merged
Conversation
…servers key Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sanitizeCapturedSecrets named every secret from its path alone, so `my-api` and `my_api` both became HARNESS_MY_API and shared one env declaration. It now dedupes with _2, _3... through uniqueVariableName, shared with the share Scrubber, and both derive names with one MAX_VARIABLE_NAME_LENGTH (116) so a suffix still fits under 120. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ktop Core exports PERSONAL_PROFILE_PATH and the legacy path. The CLI and desktop read ~/.claude/harness.yaml only when the new file is absent, with a notice, and always write the new path. ~/harness.yaml stays notice-only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A field already declared by an earlier capture (declaration description names its path) reuses that variable instead of growing a _2, _3 suffix. Declared names of other fields still count as taken. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Onboarding shows a legacy-read profile as a conflict; the portability snapshot falls back to ~/.claude/harness.yaml; the CLI prints the legacy and ignored notices once per process. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drafts persist to localStorage (harness-kit:drafts:v1) and restore on launch. Quit (Cmd+Q, Quit menu, window close) with unsaved drafts asks Save all / Discard / Cancel; with none it quits at once. Rust holds the close request and emits app://quit-requested; the webview answers via confirm_quit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ialog Rust tracks whether drafts are unsaved: a close with none goes straight through, and a held close force-quits if the webview does not acknowledge within 2 s. Quit dialog order is Don't Save, Cancel, Save All (Return saves). Stale drafts at legacy or unknown keys are migrated or dropped at load, and a rejected confirm_quit is shown in the dialog. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rtability, fix Save All for moved legacy drafts The webview fs scope does not cover ~/.harness/harness.yaml, so Drift Global and the portability snapshot saw it as absent. Both now use read_harness_file. Save All no longer sends a digest for a draft moved from the legacy file, and refuses it if the legacy file changed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…; tighten tests and capture description Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CodeQL flagged /^_+|_+$/ on config-derived names (js/polynomial-redos). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four fixes left over from the UX audit.
${env:NAME}, not${NAME}. Compile and Machine sync now write${env:NAME}to.cursor/mcp.jsonand.vscode/mcp.json. Import, drift and the grid read both forms back as${NAME}. VS Code variables like${workspaceFolder}are left alone..vscode/mcp.jsonnow uses its real root key,servers.my-apiandmy_apiused to shareHARNESS_MY_API. A clash now gets_2,_3. Capturing again reuses a field's existing name.~/.harness/harness.yaml. The CLI already used it; the desktop app, share prompt and docs now do too.~/.claude/harness.yamlis read only when the new file is missing, with a notice. It is never written or deleted. Onboarding, Drift and the portability snapshot all honor the fallback. The desktop reads the profile through the Rustread_harness_filecommand, so no new webview file access was added.Release notes
${env:NAME}. The next compile or sync rewrites existing${NAME}references once; harness.yaml keeps${NAME}.mcpServerskey in.vscode/mcp.jsonmove toservers, which is the only key VS Code reads. Compile warns when it does this. On a name clash, theserversentry wins.~/.harness/harness.yamlin the desktop app.~/.claude/harness.yamlis read only as a fallback, and the first desktop save creates the new file.~/.claude/harness.yaml, soapply,reconcile,status --globalandskills promotepick up a desktop-written profile they used to ignore. Each prints a one-line notice._2,_3, and capturing again keeps the existing names.Not in this PR
harness-kit capture --scope personaldoesn't print the "ignored" notice when both profile files exist.Test plan
~/.harness/harness.yaml🤖 Generated with Claude Code