Add Cursor sessionStart hook and minimal macos-26 CI - #4
Merged
Conversation
Wire `devctl hook install --harness cursor` into ~/.cursor/hooks.json so Agent sessions get the same <devctl-servers> context Claude Code already gets. Resolve the running binary via _NSGetExecutablePath so install from a bare PATH name does not write a cwd-relative command.
Standard arm64 runner only: swift build + swift test, SPM cache, concurrency cancel, and docs path-ignore. Skips smoke and large runners to keep wall time (and any future private-repo minutes) low.
The script recovered on the next probe after the third failure, so the unhealthy window was one interval (~30ms) and pollPhase's 50ms sample often missed it on CI. Pad failures so the assertion can observe the phase.
There was a problem hiding this comment.
Pull request overview
Adds Cursor harness support to devctl’s session-start hook system, alongside a more reliable way to discover the running devctl executable path and a minimal macOS 26 CI gate.
Changes:
- Add
cursorharness adapter and hiddenhook cursor-session-startsubcommand emitting Cursor’s{additional_context}payload. - Fix hook install (and bundled daemon lookup) to use a resolved executable path (
CLISelf.path) rather thanCommandLine.arguments[0]. - Add a minimal GitHub Actions workflow on
macos-26runningswift build+swift testwith SwiftPM caching and concurrency cancelation, and document the new harness/CI behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Sources/devctl/LaunchdAdmin.swift | Switch bundled daemon sibling lookup to use CLISelf.path for reliable self location. |
| Sources/devctl/HookSupport.swift | Introduce CLISelf, Cursor harness adapter, and shared hook session cwd resolution logic. |
| Sources/devctl/CLI.swift | Register Cursor hook subcommand and update hook install to use CLISelf.path + shared cwd resolution. |
| README.md | Document installing Cursor and Claude hooks explicitly. |
| docs/cli-contract.md | Extend CLI contract docs for hook install to include Cursor harness behavior/output. |
| CONTRIBUTING.md | Document Cursor harness adapter expectations and new minimal CI behavior. |
| BACKLOG.md | Update backlog DMG install idea to include Cursor auto-detection. |
| .github/workflows/ci.yml | Add minimal macos-26 CI workflow for build + unit tests with caching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use the standard size-query then fill pattern, and fall back to an absolute arg0 or PATH lookup instead of writing an empty path into hook settings.
Private root package.json tracks the product version (currently 1.1.0, matching existing tags). Release workflow on ubuntu opens the Version Packages PR and, on merge, tags and creates the GitHub release without npm publish. Sync DevCtlVersion.version from package.json on bump.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Internal-only work never deserves a changeset; document that in the release contributor notes.
Merged
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
devctl hook install --harness cursor) that injects the same<devctl-servers>context Claude Code already gets, via Cursor's{additional_context}schemadevctlPATH name relative to cwd (now uses_NSGetExecutablePath), with repair of a bad prior install pathmacos-26CI job:swift build+swift testonly (no smoke, no large runners), with SPM cache and concurrency cancelpackage.jsonat1.1.0(matches existingv1.1.0), Version Packages PR onmain,vX.Y.Ztags + GitHub releases on merge (no npm publish); syncsDevCtlVersion.versionfrompackage.jsonTest plan
swift testgreen locally and on CIadditional_contextwith<devctl-servers>for Candor; silent for/tmpdevctl hook install --harness cursorwrites an absolute command into~/.cursor/hooks.jsonmain, Release workflow opens/updates Version Packages PR; merging it creates the nextvX.Y.ZGitHub release