Skip to content

Add Cursor sessionStart hook and minimal macos-26 CI - #4

Merged
quantizor merged 7 commits into
mainfrom
feat/cursor-session-hook
Jul 24, 2026
Merged

Add Cursor sessionStart hook and minimal macos-26 CI#4
quantizor merged 7 commits into
mainfrom
feat/cursor-session-hook

Conversation

@quantizor

@quantizor quantizor commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a Cursor harness adapter (devctl hook install --harness cursor) that injects the same <devctl-servers> context Claude Code already gets, via Cursor's {additional_context} schema
  • Fix hook install resolving a bare devctl PATH name relative to cwd (now uses _NSGetExecutablePath), with repair of a bad prior install path
  • Add a cheap macos-26 CI job: swift build + swift test only (no smoke, no large runners), with SPM cache and concurrency cancel
  • Add Changesets for GitHub-only releases: private root package.json at 1.1.0 (matches existing v1.1.0), Version Packages PR on main, vX.Y.Z tags + GitHub releases on merge (no npm publish); syncs DevCtlVersion.version from package.json

Test plan

  • swift test green locally and on CI
  • Cursor hook probe emits additional_context with <devctl-servers> for Candor; silent for /tmp
  • devctl hook install --harness cursor writes an absolute command into ~/.cursor/hooks.json
  • Pending changeset covers the Cursor harness only (no CI note)
  • After merge to main, Release workflow opens/updates Version Packages PR; merging it creates the next vX.Y.Z GitHub release

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.
Copilot AI review requested due to automatic review settings July 24, 2026 15:32
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 cursor harness adapter and hidden hook cursor-session-start subcommand emitting Cursor’s {additional_context} payload.
  • Fix hook install (and bundled daemon lookup) to use a resolved executable path (CLISelf.path) rather than CommandLine.arguments[0].
  • Add a minimal GitHub Actions workflow on macos-26 running swift build + swift test with 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.

Comment thread Sources/devctl/HookSupport.swift
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.
@socket-security

socket-security Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​changesets/​changelog-github@​0.7.01001006893100
Added@​changesets/​cli@​2.31.19710010096100

View full report

Internal-only work never deserves a changeset; document that in the
release contributor notes.
@quantizor
quantizor merged commit 40d3e97 into main Jul 24, 2026
3 checks passed
@quantizor
quantizor deleted the feat/cursor-session-hook branch July 24, 2026 15:49
@github-actions github-actions Bot mentioned this pull request Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants