Repository navigation
fix(cursor): deploy user-scope instructions to ~/.cursor/rules - #2506
Daniel Meppiel (danielmeppiel) merged 13 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes Cursor user-scope (apm install -g / apm update -g) instruction deployment by marking Cursor as fully user-scope supported and no longer filtering out the instructions primitive, so instructions deploy via the existing cursor_rules transform to ~/.cursor/rules/*.mdc. It also updates tests, docs, and the changelog to reflect the corrected behavior.
Changes:
- Update the Cursor
TargetProfiletouser_supported=Trueand remove theunsupported_user_primitivesfilter forinstructions. - Extend unit/integration tests to assert Cursor user-scope instructions deploy/uninstall correctly and add a covering-array row for Cursor user-scope instructions.
- Update docs to reflect Cursor’s file-backed user-scope rules and add an Unreleased changelog entry.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/integration/targets.py |
Marks Cursor as fully user-scope supported and allows instructions at user scope. |
tests/unit/core/test_scope.py |
Updates scope support assertions and warning-message expectations for Cursor. |
tests/unit/integration/test_scope_integration.py |
Ensures user-scope Cursor retains instructions with cursor_rules format. |
tests/unit/integration/test_scope_install_uninstall.py |
Validates Cursor user-scope install/uninstall includes .cursor/rules/*.mdc instructions. |
tests/integration/test_primitive_target_covering_array.py |
Adds a covering-array row for Cursor instructions at user scope. |
docs/src/content/docs/reference/targets-matrix.md |
Updates Cursor target matrix to describe full user-scope instructions deployment and caveat. |
docs/src/content/docs/concepts/primitives-and-targets.md |
Updates Cursor notes to reflect full user-scope instruction support. |
CHANGELOG.md |
Adds an Unreleased “Fixed” entry describing the Cursor user-scope instructions fix. |
|
Hi Daniel Meppiel (@danielmeppiel) |
|
Yahav Itschak (@yahavi) I've triggered the CI now, and also our Agentic panel-review plus a Copilot Review with Balanced Effort (previous was Lite). Please keep an eye to further comments from the agents. As soon as any feedback is fixed please re-mention me, but I've assigned it so it keeps under my radar now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
docs/src/content/docs/reference/targets-matrix.md:167
- Cursor's official rules documentation describes
~/.cursor/rulesas machine-local user rules that apply across all projects, not as project rules discovered by walking upward from the workspace. The home-directory/cloud-agent caveat is therefore inaccurate and understates the scope of the feature.
"User Rules" surface. Rule resolution walks upward from the workspace, so
`~/.cursor/rules` applies to projects under `$HOME` (the normal local case);
Cursor cloud agents whose workspace is not under the home directory are a
known Cursor-side gap, not an APM limitation.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
docs/src/content/docs/reference/targets-matrix.md:165
- This support claim contradicts Cursor's documented model:
.cursor/rulescontains project rules scoped to the codebase, while global User Rules are a separate Settings surface. The official docs do not state that rule discovery walks above the workspace root, so a project under$HOMEis not evidence that~/.cursor/ruleswill be loaded. Retain the partial-support wording rather than documenting ineffective deployment as full support.
- **User scope.** Fully supported. Instructions deploy to
`~/.cursor/rules/<name>.mdc` (same `cursor_rules` transform as project
scope). Cursor loads those file-backed rules in addition to the Settings UI
"User Rules" surface. Rule resolution walks upward from the workspace, so
`~/.cursor/rules` applies to projects under `$HOME` (the normal local case);
docs/src/content/docs/concepts/primitives-and-targets.md:101
- Cursor does not document
~/.cursor/rules/*.mdcas a user-wide rule source;.cursor/rulesis the project-rule location and User Rules are configured separately. This line should continue to describe instructions as unavailable through APM at user scope unless a supported global storage API is identified.
- **cursor** -- Cursor IDE. Rules use the `.mdc` extension. Full user-scope support; instructions deploy to `~/.cursor/rules/*.mdc`.
CHANGELOG.md:15
- The stated fix is not supported by Cursor's documented rule resolution:
.cursor/rulesis project-scoped, and the docs do not define~/.cursor/rulesas global User Rules storage. The changelog should not promise that global installs now produce usable Cursor instructions.
- `apm install -g` / `apm update -g` now deploy instructions to
`~/.cursor/rules/*.mdc` for the Cursor target. Previously they were skipped
based on an incorrect assumption that Cursor global rules were
Settings-UI-only. (#2506)
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Clean data-only config change; removes an exclusion from the Cursor TargetProfile. Architecturally correct, no new abstractions needed. |
| CLI Logging Expert | 0 | 0 | 0 | Warning suppression is correct -- Cursor is now fully supported at user scope so removing it from the partial-support warning is the right behavior. |
| DevX UX Expert | 0 | 0 | 1 | Solid UX fix: removes a silent omission that violated install-adds-never-silently-mutates; caveat is documented; parity restored. |
| Supply Chain Security | 0 | 0 | 1 | No new security surface exposed; existing path containment and cleanup guards apply to the new user-scope write path. |
| OSS Growth Hacker | 0 | 0 | 2 | Solid silent-bug fix for a top-tier target; worth a release-note beat but not a standalone announcement. |
| Doc Writer | 2 | 2 | 1 | Docs are mostly consistent; two stale deploy-directory references omit ~/.cursor/ at user scope, and the targets-matrix user-scope block is verbose vs. peer targets. |
| Test Coverage Expert | 0 | 0 | 0 | All critical surfaces covered: deploy path has real-I/O install+uninstall cycle test; covering array adds e2e row. Ship. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [Doc Writer] Update
primitives-and-targets.mdoutput-directory table to show~/.cursor/for user scope -- Canonical quick-reference table is factually incomplete after this fix; one-line edit. - [Doc Writer] Update
targets-matrix.mddeploy-directory bullet to list both project and user-scope paths -- Peer targets already list both paths; omitting cursor's creates an inconsistency readers will hit. - [OSS Growth Hacker] Reword CHANGELOG entry to lead with user benefit -- Release notes convert better when framed as outcomes, not implementation details.
- [DevX UX Expert] Consider emitting a diagnostic note about Cursor cloud-agent gap during user-scope install -- Prevents a support trip when users discover the limitation post-install.
- [Supply Chain Security] Document user-scope blast-radius note in enterprise security docs -- Consistent with existing guidance for other targets; not a regression but worth making explicit for enterprise adopters.
Architecture
classDiagram
direction LR
class TargetProfile {
<<ValueObject>>
+capability TargetCapability
+root_dir str
+primitives dict~str, PrimitiveMapping~
+user_supported bool | str
+user_root_dir str | None
+unsupported_user_primitives tuple~str~
+user_primitive_overrides dict | None
+for_scope(user_scope bool) TargetProfile | None
+supports_at_user_scope(primitive str) bool
+deploy_path(project_root Path) Path
}
class PrimitiveMapping {
<<ValueObject>>
+sub_dir str
+extension str
+format_id str
+output_compare bool
}
class TargetCapability {
<<ValueObject>>
+display_name str
+aliases tuple~str~
}
class KNOWN_TARGETS {
<<Registry>>
+cursor TargetProfile
+copilot TargetProfile
+claude TargetProfile
}
TargetProfile *-- PrimitiveMapping : primitives dict
TargetProfile *-- TargetCapability : capability
KNOWN_TARGETS o-- TargetProfile : contains
class TargetProfile:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["KNOWN_TARGETS['cursor']"] --> B{"for_scope(user_scope=True)"}
B -->|user_supported=True| C["Filter primitives by unsupported_user_primitives"]
C -->|empty tuple now| D["All primitives pass through"]
D --> E["Apply user_primitive_overrides if any"]
E --> F["Return cloned TargetProfile\nroot_dir='.cursor'"]
F --> G["[FS] Integrator deploys to\n~/.cursor/rules/*.mdc"]
B -->|user_supported=False| H["Return None -- skip target"]
Recommendation
Ship this PR now. The code change is minimal, architecturally sound, fully tested, and resolves a real silent-failure bug for Cursor users. The two doc-table gaps are genuine but non-blocking -- they are one-line amendments the author can fold before merge or land in an immediate follow-up commit. No security, performance, or architectural concerns. Tests pass. This is a clean win for multi-harness parity.
Full per-persona findings
Python Architect
- [nit] Comment could note that cursor_rules transform is reused unchanged at user scope at
src/apm_cli/integration/targets.py
A future reader may wonder whether the cursor_rules format_id path needed any user-scope adaptation. A one-line note that the same PrimitiveMapping (format_id=cursor_rules) drives both scopes would save them a grep.
Suggested: Add inline note:# Same cursor_rules transform applies at both project and user scope.
CLI Logging Expert
No findings.
DevX UX Expert
- [nit] Caveat about cloud agents could also appear in
apm install -goutput when target is cursor
Users hitting the Cursor cloud-agent gap will see no warning at install time and only discover the limitation when rules fail to load. A one-line info diagnostic during install would save a support trip to docs.
Suggested: Emit a diagnostic note during user-scope cursor install: 'Note: ~/.cursor/rules applies to workspaces under $HOME; Cursor cloud agents outside $HOME may not pick up these rules.'
Supply Chain Security Expert
- [nit] Cursor user-scope rules directory is global blast radius for malicious instruction content at
src/apm_cli/integration/targets.py:555
Unlike project-scope rules (contained to one repo), user-scope .mdc files in ~/.cursor/rules/ are loaded across ALL projects. A compromised package delivering adversarial LLM instructions now reaches every Cursor workspace on the machine. This is equivalent to the existing behaviour for claude/copilot user-scope instructions and is not a regression, but worth noting in docs.
Suggested: Consider documenting in enterprise/security.md that user-scope instruction deployment widens blast radius to all workspaces for that IDE, consistent with how other targets already behave.
OSS Growth Hacker
- [nit] CHANGELOG entry could lead with user benefit, not internal detail at
CHANGELOG.md:12
Release notes are read by users, not maintainers. Leading with the user outcome converts better than leading with the command flags.
Suggested: Reword to: '- Cursor:apm install -gnow deploys instruction files to~/.cursor/rules/*.mdc, closing the gap between project and user scope. Previously instructions were silently skipped. (fix(cursor): deploy user-scope instructions to ~/.cursor/rules #2506)' - [nit] Targets-matrix cloud-agent caveat could note this is a Cursor-side limitation more clearly at
docs/src/content/docs/reference/targets-matrix.md
Users may interpret the caveat as an APM limitation without clear framing.
Suggested: Add: 'Note: Cursor user-scope rules apply only when the workspace is under $HOME. Remote/cloud workspaces may not inherit them.'
Auth Expert -- inactive
No auth-related files changed; targets.py edit is deploy-surface configuration, not authentication or token management.
Doc Writer
- [blocking] primitives-and-targets.md output-directory table still shows only '.cursor/' for cursor, omitting user-scope path at
docs/src/content/docs/concepts/primitives-and-targets.md:88
The table at line 88 is the canonical quick-reference for output directories. Every reader who consults it will see '.cursor/' with no user-scope path for cursor, while copilot shows both project and user-scope paths. After this fix cursor has a user-scope path too; leaving the table unchanged makes the fix invisible to the most commonly consulted surface.
Suggested: Change the cursor row to show.cursor/(project),~/.cursor/(user scope). - [blocking] targets-matrix.md 'Deploy directory' bullet for cursor omits the user-scope path at
docs/src/content/docs/reference/targets-matrix.md:153
Line 153 reads '- Deploy directory..cursor/.' After the fix, user-scope deploys land in~/.cursor/. Peer targets list both project and user paths in this bullet.
Suggested: Change to: '- Deploy directory..cursor/(project scope);~/.cursor/(user scope).' - [recommended] User scope block in targets-matrix is significantly more verbose than peer target blocks at
docs/src/content/docs/reference/targets-matrix.md:161
Peer blocks use 1-2 sentences; the new cursor block is 5 sentences. The cloud-agent caveat detail risks drift.
Suggested: Trim to: '- User scope. Fully supported. Instructions deploy to~/.cursor/rules/<name>.mdc. Cloud-agent workspaces outside$HOMEare a known Cursor-side gap.' - [recommended] Caveat bullet for claude_command transformer lacks cross-reference for diagnostics at
docs/src/content/docs/reference/targets-matrix.md:170
Says 'surfaced via diagnostics' but no link. Reader has no path forward.
Suggested: Add a link to diagnostics reference. - [nit] CHANGELOG entry uses slash notation inconsistently with surrounding entries at
CHANGELOG.md
Minor style consistency.
Suggested: Use 'and' instead of '/'.
Test Coverage Expert
No findings.
Performance Expert -- inactive
No perf-path files changed; adding one static field to a target profile is O(1) and does not affect any hot path.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Head branch was pushed to by a user without write access
|
Sergio Sisternes (@sergio-sisternes-epam) Feedback from the panel doc tables is in this push: the primitives output-directory table and the targets-matrix deploy-directory bullet now list Copilot's request to revert Cursor user-scope instructions was declined on the review thread: file-backed |
2c9005e to
e4cf21a
Compare
|
Hi Sergio Sisternes (@sergio-sisternes-epam) — when you have a moment, could you please review this PR? Thank you. |
|
Thank you for the work you have put into APM. We are closing this PR as part of a maintainer-led issue-first intake reset because we could not identify an APM issue tracking this change. Our small maintainer team cannot sustainably review implementations before agreeing which problems and scope we can support. We recognize this process was not clear when some contributions began, and we are sorry for that. This is a review-capacity decision, not a judgment of your work's quality. Thank you for responding to the existing review and following up. Those efforts remain part of this PR's history; this is not a request to repeat them. Please open an issue describing the problem and proposed scope, or point us to the existing matching issue, and link it here. For substantive changes, a responsible human maintainer must agree the scope, acceptance criteria and review contact under the contribution rules. Once the tracking and applicable scope decision are in place, please ask here to reopen this PR so the existing work can be reused. There is no need to discard your contribution or start over. The same issue-first expectations apply to maintainer-authored and automated PRs. |
|
Tracking issue for this change: #3054 That issue describes the silent skip of Cursor instructions at user scope ( Daniel Meppiel (@danielmeppiel) please review the issue for scope / acceptance criteria. Once a maintainer agrees, please reopen this PR so the existing work can land against that tracking issue. |
Cursor documents ~/.cursor/rules as included in context, so the targets matrix no longer claims an undocumented upward walk.
a28ebcb to
9702828
Compare
|
Daniel Meppiel (@danielmeppiel) / Sergio Sisternes (@sergio-sisternes-epam) - could you please give this PR an approval? |
…-scope-instructions Keep the unreleased Cursor user-scope changelog entry alongside the fixes that landed on main.
|
Thank you for carrying the approved scope from #3054 into this pull request. The linked issue is marked status/accepted, so this recommendation is ready for human review. Requested reviewers are Daniel Meppiel (@danielmeppiel) and Sergio Sisternes (@sergio-sisternes-epam). This is advisory only, not merge or scope approval. Generated by autopilot-pr-triage-worker. This comment is AI-generated and may contain errors. |
|
Yahav Itschak (@yahavi) thanks for sticking with this one, and for carrying the scope from #3054 through. The branch now has merge conflicts with This comment is AI-generated and may contain errors. |
…-scope-instructions Keep the unreleased Cursor user-scope changelog entry out of the v0.35.0 notes.
|
Thanks, Sergio Sisternes (@sergio-sisternes-epam). |
…-scope-instructions
|
Sergio Sisternes (@sergio-sisternes-epam) - can you trigger the workflow and merge? |
Brings the PR current with main. CHANGELOG.md takes main's version; the auto-merge had re-inserted the microsoft#3439 and microsoft#3407 entries a second time under 0.35.1. Co-authored-by: Copilot App <[email protected]>
The microsoft#3054 scope record requires real installed-CLI lifecycle coverage for Cursor user-scope rules: install, reinstall, update, frozen replay, read-only audit and ownership-aware removal, with independent filesystem and lockfile evidence. The new test runs both user and project scope, keeps a handwritten neighboring rule intact through removal, pins the existing rule-dir collision policy (apm#1662) and the fail-closed edited managed-file uninstall contract. Mutation-break: restoring the instructions filter on the Cursor profile fails the user case. Addresses scope gap (a) from the merge-worker plan. Co-authored-by: Copilot App <[email protected]>
The microsoft#3054 scope record asks docs, shipped guidance and code comments to describe the qualified behavior only: local Cursor 2.1+ clients include ~/.cursor/rules in context, APM manages the files and removes only package-owned rules, and cloud or remote surfaces are not qualified. Adds the same note to the apm-guide package-authoring resource. Addresses scope gaps (c), (d) and (e) from the merge-worker plan. Co-authored-by: Copilot App <[email protected]>
The microsoft#3054 done-when requires a release note under Fixed. The author's entry was dropped while resolving main conflicts; restore it in the current Unreleased block with contributor credit. Addresses scope gap (b) from the merge-worker plan. Co-authored-by: Copilot App <[email protected]>
The rule-dir ownership policy (apm#1662) replaces an existing rule whose filename matches a package rule; at user scope that now reaches ~/.cursor/rules. State it in the release note, targets matrix and shipped guidance instead of promising unconditional preservation, drop the inaccurate 'silently' (the old warning listed cursor instructions), link the concept note to the canonical matrix entry, and give the guide note its own paragraph. Addresses panel follow-ups from doc-writer (1 recommended, 2 nits) and devx-ux-expert (1 nit). Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Clean data-driven enablement via the KNOWN_TARGETS registry; no new authority or logic change. |
| Test Coverage Expert | 0 | 0 | 0 | All scope-record demands met: installed-CLI lifecycle, neighbor preservation, covering-array row, scope tests. |
| Doc Writer | 0 | 1 | 2 | Docs cite the Cursor 2.1 changelog with no upward-walk claim; disclose same-name replacement (folded). |
| Devx Ux Expert | 0 | 0 | 1 | Replaces the instruction skip with a real deploy; warning, docs and CHANGELOG aligned. |
| Supply Chain Security Expert | 0 | 0 | 1 | No regression; containment, scanning, lockfile and ownership guards apply uniformly at user scope. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 2 follow-ups
- [Apm Ceo] Maintainer manual check of native Cursor recognition:
apm install -g --target cursora small rules package, open a project in local Cursor 2.1+, confirm the rule appears in context. -- This is the only part of the [BUG] Cursor user-scope install skips instructions (no ~/.cursor/rules/*.mdc) #3054 done-when that automation here could not execute. - [Supply Chain Security Expert] Follow-up issue: a standard-verbosity warning when a rule-dir rewrite replaces an untracked same-named file at user scope. -- The existing apm#1662 policy now reaches
~/.cursor/rules; the diagnostic is verbose-only today. Out of scope here because it changes the shared rule-dir owner across Claude, Cursor and Windsurf.
Architecture
classDiagram
direction LR
class KNOWN_TARGETS {
<<Registry>>
+dict~str, TargetProfile~
}
class TargetProfile {
<<ValueObject>>
+user_supported bool|str
+unsupported_user_primitives tuple
+user_root_dir str|None
+for_scope(user_scope) TargetProfile|None
+supports_at_user_scope(primitive) bool
}
class PrimitiveMapping {
<<ValueObject>>
+subdir str
+format_id str
+output_compare bool
}
class InstructionIntegrator {
<<Integrator>>
+integrate_instructions_for_target(target) IntegrationResult
+_convert_to_cursor_rules(content) str
+sync_for_target(target) dict
}
class warn_unsupported_user_scope {
<<Pure>>
+warn_unsupported_user_scope() str
}
KNOWN_TARGETS *-- TargetProfile : contains
TargetProfile *-- PrimitiveMapping : primitives
InstructionIntegrator ..> TargetProfile : reads scoped primitives
warn_unsupported_user_scope ..> KNOWN_TARGETS : queries
class KNOWN_TARGETS:::touched
class TargetProfile:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["apm install -g --target cursor"] --> C{"TargetProfile.for_scope(user_scope=True)"}
C -->|"user_supported=True, no filter"| D["scoped profile keeps instructions"]
C -.->|"before: partial, instructions filtered"| X["instructions dropped (removed)"]
D --> F["InstructionIntegrator cursor_rules"]
F --> I["write ~/.cursor/rules/name.mdc"]
I --> J["apm.lock.yaml content_hash + owners"]
J --> K{"finalize compile hint"}
K -->|"cursor excluded"| L["no apm compile -g hint"]
Recommendation
The in-scope items from this pass are folded: same-name disclosure in CHANGELOG, targets matrix and guide; dropped "silently"; linked the concept note to the matrix; gave the guide note its own paragraph. CI is green on the latest head. Before merge, do the quick manual Cursor recognition check. Track the user-scope rule-dir collision warning as a separate issue.
Folded in this run
- (scope) Merged current
main; CHANGELOG takes main's version (the auto-merge had duplicated fix(receipts): preserve macOS identity across remounts with downgrade-safe migration #3439/fix(install): keep the locked commit as the cached source pin #3407 under 0.35.1) -- resolved in f165ca0. - (scope) Installed-CLI lifecycle test
tests/integration/test_cursor_rules_lifecycle.py, user and project scope: install, reinstall (byte/mtime/lock identical),deps update(rewrite + retire),--frozenreplay, read-only audit,audit --cidrift on an edited managed rule, fail-closed then ownership-aware uninstall that keeps a handwritten neighbor -- resolved in 1d10f5e. - (scope) Docs, shipped guidance (
packages/apm-guide) and code comment qualified to local Cursor 2.1+; cloud/remote surfaces and Settings UI User Rules called out as not managed -- resolved in d94df8d. - (scope) CHANGELOG
Fixedentry restored with contributor credit -- resolved in 270f182. - (panel) Disclose that an existing same-named rule is replaced on install (existing apm#1662 rule-dir policy), drop "silently", link concept note to the matrix, separate guide paragraph -- resolved in 2df6ed9.
Copilot signals reviewed
CHANGELOG.md-- LEGIT: entry should be one line ending with the PR number (resolved in 270f182).src/apm_cli/integration/targets.py:811-- NOT-LEGIT: keeping Cursor partial contradicts Cursor's documented 2.1 home-folder rules and the approved [BUG] Cursor user-scope install skips instructions (no ~/.cursor/rules/*.mdc) #3054 scope.docs/.../targets-matrix.md:167(suppressed) -- LEGIT: the upward-walk explanation was undocumented; replaced by the 2.1 changelog wording earlier and kept out in this run.docs/.../targets-matrix.md:165,primitives-and-targets.md:101,CHANGELOG.md:15(suppressed) -- NOT-LEGIT: same premise as above, settled by the Cursor 2.1 changelog.
Deferred (out-of-scope follow-ups)
- (panel) Standard-verbosity warning when a rule-dir rewrite replaces an untracked same-named file at user scope -- scope boundary: changes the shared apm#1662 rule-dir owner across Claude, Cursor and Windsurf; [BUG] Cursor user-scope install skips instructions (no ~/.cursor/rules/*.mdc) #3054 says preserve existing collision/force policy; suggested follow-up: new issue under area/multi-target.
Regression-trap evidence (mutation-break gate)
tests/integration/test_cursor_rules_lifecycle.py::test_cursor_rules_installed_lifecycle[user]-- restoreduser_supported="partial"+unsupported_user_primitives=("instructions",); the test FAILED as expected (along with 4 scope unit tests); guard restored.
Lint contract
ruff check and ruff format --check (src, tests and the architecture linter scripts), pylint R0801, lint-auth-signals.sh and lint-architecture-boundaries.sh all silent at the pushed head.
CI
All required checks pass on 2df6ed9 (24 success, 2 neutral, 1 skipped; license/cla pass), after 0 CI fix iteration(s).
Mergeability status
| PR | head SHA | CEO stance | iters | folds | defers | Copilot rounds | CI | mergeable | mergeStateStatus | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #2506 | 2df6ed9 |
ship_with_followups | 1 | 5 | 1 | 2 | green | MERGEABLE | BLOCKED | pending required review; manual Cursor check |
Convergence
1 outer iteration(s); 2 Copilot round(s). Final panel stance: ship_with_followups. Ready for maintainer review.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
2b14652
into
microsoft:main
Resolves the conflicting state after microsoft#2506 and microsoft#3534 landed on main. Co-authored-by: Copilot App <[email protected]>
…ursor rule under APM 0.36 APM 0.36.0 deploys user-scope instructions to ~/.cursor/rules (microsoft/apm#2506, fixing a silent omission) and ports scoped applyTo to Cursor globs (#2030). Update the fixture expectation and the distribution doc row accordingly: the file now exists, carries the applyTo pattern as globs, and is never alwaysApply.
* chore(mise): bump apm-cli to 0.36.1 * test(native): expect the scoped design instruction as a glob-scoped Cursor rule under APM 0.36 APM 0.36.0 deploys user-scope instructions to ~/.cursor/rules (microsoft/apm#2506, fixing a silent omission) and ports scoped applyTo to Cursor globs (#2030). Update the fixture expectation and the distribution doc row accordingly: the file now exists, carries the applyTo pattern as globs, and is never alwaysApply.
Fix #3054
fix(cursor): deploy user-scope instructions to ~/.cursor/rules
TL;DR
apm install -g/apm update -gfor Cursor skipped the instructions primitive because the target profile marked them unsupported at user scope. That filter is removed: Cursor is fully user-scope supported and instructions deploy via the samecursor_rulespath as project scope (~/.cursor/rules/*.mdc). Docs, CHANGELOG, and scope tests are updated to match.Note
Cursor cloud agents whose workspace is not under
$HOMEremain a Cursor-side resolution gap (documented in the targets matrix); this PR does not claim to fix that.Problem (WHY)
KNOWN_TARGETS["cursor"]setunsupported_user_primitives=("instructions",)anduser_supported="partial", sofor_scope(user_scope=True)dropped instructions before any integrator ran.apm install -g --target cursortherefore wrote agents/skills/hooks under~/.cursor/but produced zero instruction files — silent omission, not an error..mdcmodel Cursor documents for rules under.cursor/rules.Why these matter: APM’s multi-harness contract is that the same instruction primitive should land in each target’s native layout when that layout exists. Cursor’s documented project-rules surface is file-backed
.mdcunder.cursor/rules(“Project rules live in.cursor/rulesas.mdcfiles”); excluding that path at user scope broke parity with project-scope Cursor installs and with fully user-supported targets like Claude.Approach (WHAT)
user_supported=Trueand clearunsupported_user_primitivesso instructions survivefor_scope(user_scope=True).cursor_rulestransform — no new format; user scope reuses project-scope.mdcemission under~/.cursor/rules/.Implementation (HOW)
src/apm_cli/integration/targets.py— Cursor profile: full user support; comment updated to describe file-backed~/.cursor/rules/*.mdcalongside Settings UI User Rules. No new integrator code.tests/unit/core/test_scope.py— Asserts Cursor is fully supported,supports_at_user_scope("instructions")is true, and the unsupported-scope warning no longer listscursor (instructions).tests/unit/integration/test_scope_install_uninstall.py— User-scope install/uninstall cycle expects.cursor/rules/*.mdcplus agents, and cleans both up.tests/unit/integration/test_scope_integration.py— Resolved user-scope Cursor profile retainscursor_rulesinstructions.tests/integration/test_primitive_target_covering_array.py— Addscursor-instruction-usercovering row.docs/.../primitives-and-targets.md,docs/.../targets-matrix.md,CHANGELOG.md— Document full user-scope support and the home-directory / cloud-agent caveat.Diagrams
Legend: user-scope Cursor install now keeps instructions through
for_scope, then reuses the existingcursor_ruleswriter into~/.cursor/rules/*.mdc(dashed = newly exercised path).flowchart LR subgraph Resolve[for_scope user_scope] P[KNOWN_TARGETS.cursor] F[filter unsupported_user_primitives] O[scoped TargetProfile] P --> F --> O end subgraph Deploy[InstructionIntegrator] I[instructions remain in primitives] T[cursor_rules transform] W["write ~/.cursor/rules/*.mdc"] I --> T --> W end O --> I classDef new stroke-dasharray: 5 5; class I,T,W new;Trade-offs
cursor_rulesat user scope vs invent a Settings-UI sync path. Chose file deploy; rejected UI automation because APM’s install model is filesystem-native and Cursor already loads.mdcrules from disk for workspaces under$HOME.partial. Chose full support once instructions were unblocked; remaining Settings UI “User Rules” plaintext is additive, not a missing APM primitive.$HOMEleft as documented caveat. Surgical fix; fixing Cursor’s resolution walk is out of scope.Benefits
apm install -g --target cursordeploys instruction.mdcfiles under~/.cursor/rules/(previously 0 files).cursor_rules), reducing format drift.Validation
Key assertions exercised
TestTargetProfileUserScope::test_cursor_is_supported_at_user_scopeTestTargetProfileUserScope::test_supports_at_user_scope_cursorTestScopeWarnings::test_warn_message_includes_unsupported_primitives(cursor (instructions)absent)TestCursorInstallUninstallCycle::test_user_scope(deploy + uninstall.mdc+ agents)cursor-instruction-userScenario Evidence
apm install -g --target cursordeploys instruction rules as~/.cursor/rules/*.mdcand uninstall removes themtests/unit/integration/test_scope_install_uninstall.py::TestCursorInstallUninstallCycle::test_user_scope(regression-trap)instructionsis not filtered byfor_scopetests/unit/core/test_scope.py::TestTargetProfileUserScope::test_cursor_is_supported_at_user_scopetests/unit/core/test_scope.py::TestTargetProfileUserScope::test_supports_at_user_scope_cursortests/unit/integration/test_scope_integration.py::TestResolveTargetsConsistencycursor (instructions)tests/unit/core/test_scope.py::TestScopeWarnings::test_warn_message_includes_unsupported_primitivestests/integration/test_primitive_target_covering_array.py(cursor-instruction-user)How to test
apm install -g --target cursorfor a package that ships.apm/instructions/→ expect new~/.cursor/rules/*.mdcfiles.$HOMEin Cursor Agent and confirm the deployed rule appears in context (or via Rules UI /@-mention).apm uninstall -g --target cursor <pkg>→ those.mdcfiles are removed; other~/.cursor/content for the package is cleaned as before.uv run python -m pytest tests/unit/core/test_scope.py tests/unit/integration/test_scope_install_uninstall.py::TestCursorInstallUninstallCycle -qstays green.Co-authored-by: Copilot [email protected]