Skip to content

[codex] Port universal applyTo to Cursor alwaysApply - #2030

Merged
Daniel Meppiel (danielmeppiel) merged 15 commits into
microsoft:mainfrom
WilliamK112:codex/apm-cursor-always-1744
Nov 12, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 15 commits into
microsoft:mainfrom
WilliamK112:codex/apm-cursor-always-1744

Conversation

@WilliamK112

@WilliamK112 Ching Wei Kang (WilliamK112) commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1744.

This ports APM's explicit universal instruction intent to Cursor's native always-on rule shape. When a source instruction declares applyTo: "**", Cursor output now emits alwaysApply: true and omits globs:. Scoped patterns still emit globs: as before.

This follows the maintainer clarification on #1744: do not add a new APM source alwaysApply field; translate the existing universal applyTo: "**" intent into Cursor's native form.

What changed

  • Convert exactly one normalized universal glob (**) to alwaysApply: true.
  • Preserve scoped scalar, comma-list, and YAML-sequence behavior.
  • Keep absent or empty applyTo free of both alwaysApply and globs.
  • Add focused, end-to-end, and executable conformance regression tests.
  • Document the transform and add a changelog entry.
  • Add OpenAPM req-tg-015 in Section 8.5.9, its manifest/index entry, and regenerated conformance statements.

Current-main reconciliation

  • Merged current main through 1cab81dc in b42d7ba4.
  • Preserved upstream req-pl-018 and its OpenAPM 0.1.40 amendment.
  • Recorded the Cursor amendment as OpenAPM 0.1.41; the combined specification has 123 normative statements (118 MUST, 5 SHOULD).
  • The PR remains limited to the original 10 implementation, test, spec, generated-conformance, changelog, and documentation files relative to current main.

Validation

  • Required unit command: 22,282 passed, 42 skipped, 21 xfailed (1 deselected)
  • Full spec conformance: 203 passed, 2 skipped
  • Focused Cursor and manifest conformance tests: 192 passed, 1 skipped
  • Full Ruff check and format checks: passed
  • Conformance artifacts regenerated from the merged tree
  • git diff --check: passed

Signed-off-by: WilliamK112 [email protected]

@WilliamK112
Ching Wei Kang (WilliamK112) marked this pull request as ready for review July 5, 2026 00:47
Copilot AI review requested due to automatic review settings July 5, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Rebased the one scoped PR commit onto the rewritten current main history and resolved the changelog conflict. I also brought the change into compliance with the current OpenAPM governance gate by adding req-tg-008 plus generated conformance evidence. Validation: 117 implementation tests and 146 conformance tests pass; Ruff, docs build, and all 937 relative links are clean.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Rebased the scoped change onto current main (703dd9e) and resolved the new spec-governance conflict: upstream now owns req-tg-008, so this Cursor always-on contract is req-tg-009 / Section 8.5.4 with the cumulative statement count updated to 108. The PR is mergeable again and remains limited to the same 10 implementation, test, spec, generated-conformance, and documentation files.\n\nValidation on the rebased tree:\n- 272 implementation + spec-conformance tests passed, 2 skipped\n- Ruff check and format check passed\n- generated CONFORMANCE.{json,md} reports 108 requirements and req-tg-009 active\n- Astro docs build passed; 950 generated relative links checked with no failures\n- git diff --check passed

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current main (3aa03655) and force-updated the branch at 37d763a2.

The implementation now preserves current-main frontmatter normalization and adds only the requested Cursor mapping: exactly one normalized ** glob emits alwaysApply: true; scoped patterns remain globs, and absent/empty applyTo emits neither key. I also reconciled the normative addition with the current spec as req-tg-011 / Section 8.5.5 and regenerated conformance artifacts.

Validation is summarized in the updated PR body: focused tests 172 passed/1 skipped, full spec-conformance 159 passed/2 skipped, full-tree Ruff checks green, and the docs build plus 967-link validation passed. The broader unit run's sole stop was the unrelated DNS-sensitive SSRF test documented in the body.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/apm_cli/integration/instruction_integrator.py:492

  • This docstring uses a non-ASCII arrow character in the text "applyTo -> globs". The repo's encoding rules require printable ASCII in source files; replace it with plain "->" to avoid Windows encoding issues and match the rest of this module.
        Parses existing YAML frontmatter, maps ``applyTo`` → ``globs``,
        extracts or generates a ``description``, and rewrites the
        frontmatter in Cursor's expected format. Explicit universal
        ``applyTo: "**"`` becomes ``alwaysApply: true`` instead of a glob.

tests/spec_conformance/test_manifest_reqs.py:817

  • The conformance drift assertion needle "MUST contain alwaysApply: true and MUST NOT contain a" is truncated and too generic, which weakens the drift-detection contract (it could match unrelated spec text). Include the full phrase through "globs field" (preserving the newline) to pin the intended invariant.
    assert_spec_contains(
        "`.cursor/rules/<name>.mdc`",
        "MUST contain `alwaysApply: true` and MUST NOT contain a",
        "MUST encode the source patterns in\n`globs`",
        "MUST omit both `alwaysApply` and `globs`",

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_now

Clean correctness fix: universal applyTo now emits Cursor-native alwaysApply:true -- panel unanimous, ship now.

cc Ching Wei Kang (@WilliamK112) Daniel Meppiel (@danielmeppiel) Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

All active panelists agree this is a well-scoped correctness fix with thorough test coverage. No dissent on architecture, security, or DevX. The python-architect's named-predicate suggestion is a readability nit, not a blocking concern.

The doc-writer raised a legitimate gap: the absent/empty applyTo case is handled correctly in code and tests but undocumented across four pages. This is a follow-up, not a gate -- the PR improves the status quo and the missing prose doesn't regress any existing reader expectation since the behavior was previously undocumented entirely.

Strategically, Cursor is a top-of-funnel integration target. Shipping this quickly and cleanly reinforces the 'it just works' promise for the fastest-growing editor audience.

Aligned with: portable_by_manifest -- Universal applyTo now correctly translates to each target's native idiom -- Cursor gets alwaysApply, others get globs. | multi_harness_multi_host -- Strengthens multi-harness story: same manifest, correct output per editor. | pragmatic_as_npm -- Silent correctness fix -- producers don't change anything, consumers get the right behavior.

Growth signal. Cursor compatibility is a top-of-funnel signal for APM adoption. The growth-hacker recommends a short 'APM + Cursor' beat when this ships -- 'Universal instructions now truly universal in Cursor.' Low effort, high recognition for the Cursor-native audience. Consider adding a Cursor row to the targets-matrix docs as a follow-up.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Clean, minimal change that correctly translates universal applyTo intent into Cursor's native alwaysApply form. The conditional logic is well-placed inside the existing rendering path, maintains single-owner authority (_convert_to_cursor_rules owns Cursor frontmatter shape), and test coverage is thorough including edge cases.
DevX UX Expert 0 0 0 No CLI surface, command help, error wording, or first-run flow changes. The fix aligns emitted Cursor metadata with the platform's own schema, improving silent correctness for users who set universal applyTo -- good DevX, no action needed.
Supply Chain Security Expert 0 0 0 No new supply-chain attack surface: alwaysApply:true is semantically equivalent to the prior globs:'**' output; governance policy gates remain unchanged.
OSS Growth Hacker 0 0 0 Correctness fix for a high-value integration target (Cursor); removes silent friction for producers, strengthens the 'it just works' story. No conversion-surface regressions.
Doc Writer 0 1 3 Docs are accurate on the new two-case framing but consistently omit the third case (absent/empty applyTo -> neither key), which the spec covers correctly; all four pages need a short clause to close that gap.
Test Coverage Expert 0 0 0 All new behavioral paths (alwaysApply mapping, padded input, YAML-list universal, null applyTo) have dedicated unit tests plus an integration test deploying to filesystem. Critical surfaces are covered.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 2 follow-ups

  1. [Doc Writer] Document the absent/empty applyTo case across four docs pages -- Third behavioral case (no applyTo -> neither key emitted) is tested but undocumented; closes a reader confusion gap.
  2. [Python Architect] Extract _is_universal_glob predicate -- Readability improvement; makes domain knowledge self-documenting.

Architecture

classDiagram
    direction LR
    class BaseIntegrator {
        <<Abstract>>
        +integrate()
        +cleanup()
    }
    class InstructionIntegrator {
        +integrate_package_instructions_cursor()
        +_convert_to_cursor_rules(content) str$
        -_extract_frontmatter()
    }
    class parse_apply_to {
        <<Pure>>
        +parse_apply_to(raw) list~str~
    }
    class yaml_double_quote {
        <<Pure>>
        +yaml_double_quote(s) str
    }
    BaseIntegrator <|-- InstructionIntegrator
    InstructionIntegrator ..> parse_apply_to : calls
    InstructionIntegrator ..> yaml_double_quote : calls
    note for InstructionIntegrator "Single owner of .mdc frontmatter shape;\nnew alwaysApply branch lives here"
    class InstructionIntegrator:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A["_convert_to_cursor_rules(content)"] --> B["Extract YAML frontmatter\napplyTo, description"]
    B --> C["parse_apply_to(apply_to)"]
    C --> D{"globs == ['**']?"}
    D -->|Yes| E["Emit alwaysApply: true"]
    D -->|No| F{"len(globs) == 1?"}
    F -->|Yes| G["Emit globs: single"]
    F -->|No| H{"globs non-empty?"}
    H -->|Yes| I["Emit globs: list"]
    H -->|No| J["Omit globs entirely"]
    E --> K["Append body, return .mdc string"]
    G --> K
    I --> K
    J --> K
Loading

Recommendation

Unanimous panel, full test coverage, no security or breaking-change concerns. The doc gap is real but non-blocking -- file a follow-up issue and merge.


Full per-persona findings

Python Architect

  • [nit] Extract universal-glob detection into a named predicate at src/apm_cli/integration/instruction_integrator.py:520
    The check globs == ["**"] encodes domain knowledge inline. A tiny helper like _is_universal_glob(globs) would make the intent self-documenting.
    Suggested: def _is_universal_glob(globs: list[str]) -> bool: return globs == ["**"]

CLI Logging Expert -- inactive

No CLI output, logging, or diagnostic rendering changes; nothing in scope for this persona.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

PR touches only instruction-integrator serialization, spec conformance, and docs -- no auth, token, credential, or remote-host files changed.

Doc Writer

  • [recommended] Inline prose paragraph omits the absent/empty applyTo case for Cursor at docs/src/content/docs/producer/author-primitives/instructions-and-agents.md:69
    The new paragraph covers two cases (** -> alwaysApply, other -> globs) but omits the third: absent or empty applyTo emits neither key. Authors who omit applyTo will be confused.
    Suggested: Append: 'When applyTo is absent or empty, APM emits neither key -- the rule deploys without alwaysApply or globs.'

  • [nit] Instructions table row omits absent/empty applyTo case at docs/src/content/docs/producer/author-primitives/instructions-and-agents.md:117
    Table cell says 'other applyTo values -> globs:' but absent/empty -> neither is not mentioned.
    Suggested: Extend the cell: '... ; absent or empty applyTo -> neither key emitted'.

  • [nit] targets-matrix.md cursor bullet omits the absent applyTo case at docs/src/content/docs/reference/targets-matrix.md:156
    Same gap as above: reader debugging a rule with no applyTo gets no signal.
    Suggested: Append '; absent or empty applyTo omits both keys' to the bullet.

  • [nit] Prose says 'explicit' applyTo: '**' but YAML-list form also triggers alwaysApply at docs/src/content/docs/producer/author-primitives/instructions-and-agents.md:66
    applyTo: ["**"] (list form) also resolves to alwaysApply:true. The word 'explicit' without qualification implies only the scalar form.
    Suggested: Rephrase to 'an applyTo value that resolves to a single universal ** glob -- whether scalar or single-element list --'.

Test Coverage Expert

No findings.

Performance Expert -- inactive

No changes touch the performance fast-path (cache, transport, resolver, pipeline, materialization); the diff is a static frontmatter-format helper invoked once per file write with no loops, I/O, or algorithmic concerns.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@sergio-sisternes-epam Sergio Sisternes (sergio-sisternes-epam) removed the panel-review Request an advisory PR review; consumed after review. Not human approval or a merge gate. label Aug 18, 2026
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (8993dcc6) and resolved the two documentation conflicts without dropping either upstream change.

The upstream executable-consent amendment remains 0.1.28; this Cursor amendment is now 0.1.29, with cumulative conformance totals updated to 113 requirements / 108 MUST. I regenerated CONFORMANCE.json and CONFORMANCE.md from the manifest.

I also addressed the review-panel follow-ups in this head:

  • document absent/empty applyTo behavior in the producer guide, target table, and Cursor matrix
  • clarify that scalar and single-item YAML-list universal globs both map to alwaysApply: true
  • replace the non-ASCII docstring arrow
  • make the spec drift assertion match the complete globs prohibition phrase

Validation on 4799f537:

  • 280 relevant unit + spec-conformance tests passed; 2 skipped
  • changed Python files pass ruff check and ruff format --check
  • conformance artifacts regenerate deterministically
  • git diff --check passed

The full-tree ruff invocation still reports seven pre-existing findings in untouched files; none are in this PR's files.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the latest main-branch conflicts in 8051fac.

Main now owns req-tg-011 / spec revision 0.1.29 for the Agent Plugins deployment boundary, so I preserved that requirement and renumbered this Cursor contract to req-tg-012, Section 8.5.6, revision 0.1.30. The generated conformance artifacts now report 114 requirements / 109 MUST and bind both requirements to their respective tests.

Validation on the merged tree:

  • instruction-integrator + manifest conformance: 175 passed, 1 skipped
  • full spec conformance: 162 passed, 2 skipped
  • Ruff format/check: passed
  • git diff --check: passed
  • diff against current main: still the original 10 scoped files

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Merged current main into the branch at signed head a6fb46c9 and resolved the three spec/conformance conflicts by taking the union of all requirements.

  • preserved upstream req-pl-017, req-pr-006, req-pr-007, and req-sc-015
  • retained this PR's still-unoccupied req-tg-013
  • advanced the Cursor amendment to spec revision 0.1.35
  • regenerated conformance at 119 requirements / 114 MUST
  • confirmed the PR remains the original 10 scoped files relative to current main

Validation:

  • Cursor integrator + complete spec-conformance + universal-applyTo integration fast path: 293 passed, 2 skipped
  • full-tree Ruff check and format check: passed
  • conformance regeneration: deterministic
  • diff whitespace checks: passed

The required full unit command reaches 1,675 passed / 1 skipped, then fails test_oserror_reading_file_adds_error. I reproduced the identical failure at the identical point in a detached origin/main@7c7e0832 worktree, and the involved implementation/test files have no PR diff, so this is a current-main baseline failure rather than a regression in this change.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the post-release conflict at 30614aa1. I preserved the complete upstream 0.29.0 release section and moved this still-unreleased Cursor fix into the new Unreleased / Fixed section; the PR remains the original 10 scoped files relative to current main.

Validation on the merged tree:

  • Cursor integrator + manifest conformance: 181 passed, 1 skipped
  • orphan check: 119 requirements aligned
  • conformance regeneration: deterministic
  • full-tree Ruff check and format check: passed
  • Tier-1 unit run: 3,568 passed / 1 skipped before the unchanged DNS-sensitive test_starts_daemon_thread_for_https resolved analytics.example.com internally and stopped under -x; its implementation and test files are byte-identical to current main
  • git diff --check: passed

Preserve upstream req-tg-013 and assign the Cursor universal instruction contract to req-tg-014.
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the latest main-branch conflict at a65addf9.

Upstream now owns req-tg-013 / Section 8.5.7 for the Agent Plugins native lifecycle, so I preserved it unchanged and moved this Cursor universal-instruction contract to req-tg-014 / Section 8.5.8 (spec revision 0.1.37). The generated conformance artifacts now report 120 requirements / 115 MUST, and the PR remains limited to the original 10 scoped files relative to current main.

Validation on the merged tree:

  • Cursor integrator + manifest/generator conformance: 185 passed, 1 skipped
  • full spec-conformance suite: 178 passed, 2 skipped
  • orphan check: 120 requirements aligned
  • full-tree Ruff check and format check: passed
  • diff whitespace checks: passed

The broader unit runs encountered two unchanged environment-sensitive network tests; both are documented in the updated PR description, including the passing isolated proxy-sensitive test.

Preserve upstream req-rs-017 and advance the Cursor contract to OpenAPM revision 0.1.38.
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the new post-update conflict at 20b737b1.

Current main added req-rs-017 in OpenAPM revision 0.1.37; I preserved that amendment and advanced this Cursor req-tg-014 contract to revision 0.1.38. The PR is mergeable again and remains the same 10 scoped files.

Fresh validation:

  • Cursor integrator + manifest/generator conformance: 185 passed, 1 skipped
  • full spec-conformance suite: 193 passed, 2 skipped
  • orphan check: 121 requirements aligned
  • full-tree Ruff check and format check: passed
  • generated conformance: 121 requirements / 116 MUST

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the latest main-branch conflict at 45cfd102.

Current main added the req-lk-005 lockfile amendment as OpenAPM revision 0.1.38; I preserved it unchanged and advanced this Cursor req-tg-014 amendment to revision 0.1.39. The PR remains the same 10 scoped files relative to current main.

Fresh validation:

  • Cursor integrator + full spec-conformance suite: 314 passed, 2 skipped
  • orphan check: 121 requirements aligned
  • Ruff check/format for src/ and tests/: passed
  • architecture-boundary linter: passed
  • diff whitespace checks: passed

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Current main advanced again while the prior reconciliation was being validated, so I merged the new head 7053bc94 at daf726fb.

I preserved the upstream frontmatter/YAML and plugin-intake changes. The YAML parser now returns None for an explicit null description, so the merged code also preserves the prior behavior of deriving the Cursor description from the body instead of serializing "None". The PR remains limited to the same 10 files relative to current main.

Fresh validation:

  • Cursor integrator + full spec-conformance suite: 324 passed, 2 skipped
  • orphan check: 121 requirements aligned
  • focused Ruff check/format: passed
  • architecture-boundary linter: passed
  • diff whitespace checks: passed

The full src/ + tests/ Ruff run now reaches an unchanged current-main F821 in src/apm_cli/integration/mcp_config_view.py:245; that file is byte-identical to current main in this PR.

@WilliamK112

Ching Wei Kang (WilliamK112) commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Resolved the latest main conflict in 1d9e0bc9.

  • Merged main through c6fde641.
  • Preserved upstream req-tg-014 / Section 8.5.8 / v0.1.39 for the user-scoped MCP target contract.
  • Advanced this Cursor contract to req-tg-015 / Section 8.5.9 / v0.1.40.
  • Regenerated the 122-requirement conformance artifacts.
  • Kept the PR diff limited to its original 10 intended files relative to current main.

Validation is green for the focused Cursor/manifest suite (192 passed, 1 skipped), full spec-conformance suite (197 passed, 2 skipped), 122-requirement orphan check, full Ruff check/format, auth-signal lint, architecture-boundary lint, and Mode B detector. An extended unit sweep passed 20,978 tests (plus expected skips/xfails); three unchanged current-main modules hit local DNS-dependent SSRF assumptions because their documentation-only hostnames resolve internally in this environment.

The fresh hosted workflows are currently awaiting maintainer approval for this external-contributor branch.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the latest conflict with current main (1cab81dc) in merge commit b42d7ba4.

The reconciliation keeps main's new req-pl-018 / OpenAPM 0.1.40 amendment and records this PR's Cursor req-tg-015 as the next amendment, OpenAPM 0.1.41. The combined specification now reports 123 normative statements (118 MUST, 5 SHOULD), and the conformance artifacts were regenerated from the merged tree.

Fresh validation on the exact merged tree:

  • required unit command: 22,282 passed, 42 skipped, 21 xfailed (1 deselected)
  • full spec-conformance suite: 203 passed, 2 skipped
  • focused Cursor + manifest conformance tests: 192 passed, 1 skipped
  • full-tree Ruff check and format check: passed
  • git diff --check: passed

GitHub now reports the PR as mergeable; it remains blocked only on repository review/queue policy.

Preserve the upstream GitLab sparse-transport work while retaining the Cursor universal applyTo behavior and req-tg-015 conformance coverage.

Signed-off-by: Ching-Wei Kang <[email protected]>
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Merged current main through 146b24f8 in signed merge commit 4aaf53b3, preserving the upstream GitLab sparse-transport work and this PR's still-unique req-tg-015 / OpenAPM 0.1.41 amendment. The regenerated artifacts remain at 123 requirements (118 MUST, 5 SHOULD), and the PR diff is still limited to the original 10 scoped files.

Fresh validation on the exact merged tree: 336 relevant implementation/conformance tests passed, 2 skipped; the 123-requirement orphan check, focused Ruff check/format, architecture-boundary lint, auth-signal lint, Mode B detector, and diff checks all passed. GitHub now reports the branch mergeable; the remaining block is repository review/workflow policy.

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

PR triage recommendation

needs-issue

Recommendation only, not merge or scope approval. A responsible
human maintainer must approve. Labels, automated advice, and
silence are not approval.

Linked issue

#1744 (open). Current labels: type/feature, area/cli, theme/portability, priority/low, triage/recommended. It does not carry status/accepted. Maintainer Daniel Meppiel (@danielmeppiel) posted a 2026-07-04 design clarification (port explicit applyTo: "**" to Cursor alwaysApply: true; do not add a source alwaysApply field). That comment is not status/accepted.

Proposed classification

type/feature, area/cli, theme/portability on this PR (those dimensions were empty). Existing human choices on #1744 stay unchanged.

Suggested next action

Keep #1744 as the scope thread and wait for a maintainer to record status/accepted there before treating this PR as invited implementation. Do not merge from this recommendation. CODEOWNERS review requests remain Daniel Meppiel (@danielmeppiel) and Sergio Sisternes (@sergio-sisternes-epam); this comment does not add or remove reviewers.

Suggested PR comment

Thank you Ching Wei Kang (@WilliamK112) for contributing this pull request and for keeping it rebased. APM starts with an issue, not an implementation (https://github.com/microsoft/apm/blob/main/CONTRIBUTING.md). This PR already links #1744, but that issue is not labelled status/accepted, so a maintainer has not recorded scope approval yet. Please leave the user problem and design on #1744 for maintainer review and acceptance first. This PR is labelled status/deferred until that happens. This is not merge approval and does not assign or request reviewers.

@sergio-sisternes-epam Sergio Sisternes (sergio-sisternes-epam) added triage/recommended Automated advice completed; not human scope approval. status/deferred Not invited for implementation now; no release commitment. type/feature New capability, new flag, new primitive. area/cli CLI command surface, flags, help text (cross-cutting). theme/portability labels Sep 16, 2026
Reconcile microsoft#1744 with current main. Main now renders Cursor globs as one
comma-joined scalar (microsoft#3002/microsoft#3011), owns req-tg-015 (Codex agent model)
and Section 8.5.9 (Cursor hooks), and is at working-draft revision
0.1.57. Keep main's rendering and add only the universal branch:
exactly one parsed `**` emits `alwaysApply: true` with no globs, via a
named `_is_universal_glob` predicate (panel nit). Renumber the spec
amendment to req-tg-018 / Section 8.5.10 / 0.1.58 (proposed), restate
it against comma-scalar globs with the nine-case boundary from the
apm-scope:v1 record, bind a nine-case conformance test, regenerate
CONFORMANCE from main's coverage plus the new node IDs, update the
apm-usage guide, author and targets-matrix docs (absent/empty/null case), and move the
CHANGELOG entry to Unreleased.

Co-authored-by: WilliamK112 <[email protected]>
Co-authored-by: Copilot App <[email protected]>
The apm-scope:v1 record on microsoft#1744 requires installed-CLI proof of the
nine applyTo source cases at project and user scope, idempotent
reinstall, replacement of a previously generated `globs: **` rule, and
preservation of handwritten neighboring rules. Add one real-binary
lifecycle test parametrized over project and user scope that pins exact
rule bytes, lock hashes and repeat-install snapshots. Mutation-break:
removing the universal branch fails both scopes.

Co-authored-by: WilliamK112 <[email protected]>
Co-authored-by: Copilot App <[email protected]>
@danielmeppiel

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_with_followups

Cursor universal rules now use native alwaysApply:true -- spec-backed, e2e-proven at both scopes, all prior follow-ups addressed.

panel-mode=full; personas=python-architect,test-coverage-expert,doc-writer,devx-ux-expert (adhoc: changes what apm install writes into Cursor rules),oss-growth-hacker,apm-ceo

cc Ching Wei Kang (@WilliamK112) Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

All five panelists converge: the delta since the prior ship_now advisory (2026-08-18) is exactly what was asked for. Both prior follow-ups are addressed -- _is_universal_glob is extracted as a module-level predicate, and absent/empty/null applyTo is documented and tested. The spec amendment lands as req-tg-018 / 8.5.10 with a clean renumber after the main merge absorbed req-tg-015. The installed-CLI e2e suite (project + user scope, 9 case forms, idempotent reinstall, legacy replacement, handwritten preservation) is the strongest new signal: 2 passed, mutation-break 5 failed, confirming the branch is load-bearing.

The only finding above nit severity is the doc-writer's recommended dedup of the new Cursor paragraph in instructions-and-agents.md, which repeats the table row and uses list syntax before the page introduces it. It is in-scope for the merge worker to fold. The doc-writer, devx-ux-expert, and oss-growth-hacker independently flag the targets-matrix density and CHANGELOG wording and converge on a tighter rewrite. None of these items change behavior or test coverage.

Strategically, this PR delivers on the 'APM speaks each tool's native language' promise, and it is spec-gated (req-tg-018 MUST). The contributor credit to Ching Wei Kang (@WilliamK112) in the CHANGELOG is correct and visible.

Aligned with: portable by manifest -- author declares applyTo once and each target gets its native form; multi-harness -- Cursor emits the native alwaysApply flag, other targets unchanged; pragmatic as npm -- no new author fields or migration steps, reinstall converges by lock-hash match; OSS community -- Ching Wei Kang (@WilliamK112)'s contribution, credited, against an approved #1744 scope.

Growth signal. Story-shaped release beat: 'APM speaks each tool's native language -- Cursor always-on rules use alwaysApply.' The CHANGELOG entry should lead with the user benefit.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 2 Clean owner-extension of _convert_to_cursor_rules; predicate and description-null guard correctly scoped. No parallel authority.
Test Coverage Expert 0 0 1 All nine Done-when cases covered at unit, conformance and installed-CLI e2e tiers at project and user scope; ship.
Doc Writer 0 1 2 Docs match the code and cover absent/empty/null; cut the duplicated Cursor paragraph and say what Cursor does with keyless rules.
DevX UX Expert 0 0 1 Install converges to Cursor-native alwaysApply; no new flags or author fields; upgrade safe via lock hash.
OSS Growth Hacker 0 0 2 Docs and CHANGELOG document the mapping; two readability nits on conversion surfaces.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 5 follow-ups

  1. [Doc Writer] Deduplicate the new Cursor paragraph in instructions-and-agents.md that repeats the table row. -- Keep the table as the source of truth; add one reinstall sentence after it.
  2. [Doc Writer] Clarify that absent/empty/null applyTo in Cursor means the rule is applied by description, not always-on. -- Prevents confusing "neither key" with always-on.
  3. [OSS Growth Hacker] Rewrite the CHANGELOG entry to lead with the user-facing benefit. -- Primary upgrade-funnel surface; doc-writer also flagged length.
  4. [DevX UX Expert] Split the targets-matrix Cursor instructions bullet into three sub-bullets. -- Restores scanning parity with other targets.
  5. [Test Coverage Expert] Optional: parametrize the e2e test by case. -- Low priority; the req-tg-018 conformance test already gives per-case IDs.

Architecture

classDiagram
    direction LR
    class BaseIntegrator {
        <<Base>>
        +resolve_links(content, src, tgt) tuple
        +sync_remove_files() dict
    }
    class InstructionIntegrator {
        <<Integrator>>
        +integrate_instructions_for_target() IntegrationResult
        +_convert_to_cursor_rules(content) str
        +_render_instruction(src, tgt, fmt) tuple
    }
    class PatternHelpers {
        <<Module>>
        +normalize_apply_to() str
        +parse_apply_to() list
        +escape_apply_to_segment() str
    }
    class UniversalGlobCheck {
        <<Pure>>
        +_is_universal_glob(globs) bool
    }
    BaseIntegrator <|-- InstructionIntegrator
    InstructionIntegrator ..> PatternHelpers : imports
    InstructionIntegrator ..> UniversalGlobCheck : calls
    class InstructionIntegrator:::touched
    class UniversalGlobCheck:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A["apm install --target cursor"] --> B["InstructionIntegrator"]
    B --> E["_convert_to_cursor_rules"]
    E --> G["normalize_apply_to + parse_apply_to"]
    G --> I{"_is_universal_glob?"}
    I -- "exactly one **" --> J["alwaysApply: true"]
    I -- "other non-empty" --> K["globs: comma-joined scalar"]
    I -- "empty" --> L["neither key"]
    J --> M["write .cursor/rules/name.mdc"]
    K --> M
    L --> M
Loading

Recommendation

Ship after the merge worker folds the doc-writer's paragraph dedup and the CHANGELOG/targets-matrix prose polish (items 1-4 above). All behavior and test coverage is correct today; the follow-ups are prose-only. Daniel Meppiel (@danielmeppiel) and Sergio Sisternes (@sergio-sisternes-epam) should confirm the spec renumber (req-tg-018 / 8.5.10) and the proposed 0.1.58 revision.


Full per-persona findings

Python Architect

  • [nit] _is_universal_glob is pattern-classification logic; natural home is patterns.py at src/apm_cli/integration/instruction_integrator.py:40
    One call site today, so inline placement is acceptable; move it to patterns.py if a second converter needs it.
  • [nit] Design patterns assessment: Base + subclass unchanged; pure predicate extracted per prior panel nit. No further pattern needed.

Test Coverage Expert

  • [nit] E2E test checks nine cases in one loop per scope at tests/integration/test_cursor_always_apply_e2e.py
    Mitigated by the nine-way parametrized req-tg-018 conformance test.
    Proof (passed): tests/integration/test_cursor_always_apply_e2e.py::test_cursor_universal_apply_to_installs_always_apply[project] + [user] -- proves: universal applyTo installs as alwaysApply:true without globs at both scopes; other forms unchanged; reinstall idempotent; legacy globs:** replaced; handwritten rules preserved. [multi-harness-support,devx]

Doc Writer

  • [recommended] New Cursor paragraph repeats the table row at docs/src/content/docs/producer/author-primitives/instructions-and-agents.md:66
    Suggested: delete it; keep the table row and add one reinstall sentence after the table.
  • [nit] Say what Cursor does with keyless rules at docs/src/content/docs/producer/author-primitives/instructions-and-agents.md:123
  • [nit] Trim the 53-word CHANGELOG entry at CHANGELOG.md:24

DevX UX Expert

  • [nit] targets-matrix Cursor bullet is ~290 chars at docs/src/content/docs/reference/targets-matrix.md
    Suggested: three sub-bullets.

OSS Growth Hacker

  • [nit] CHANGELOG entry leads with implementation detail at CHANGELOG.md:24
  • [nit] targets-matrix Cursor line breaks scanning parity at docs/src/content/docs/reference/targets-matrix.md:167

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-review-worker. This comment is AI-generated and may contain errors.

Addresses APM Review Panel follow-ups 1-5 on head 0c5d527: drop the
author-page paragraph that duplicated the Cursor table row (keep the
row as source of truth, add the reinstall note after the table), say
that keyless Cursor rules are chosen from `description`, split the
targets-matrix Cursor bullet into three sub-bullets, lead the
CHANGELOG line with the user-facing change, and compare all nine e2e
renders in one dict so a failure names every mismatched case.

Co-authored-by: WilliamK112 <[email protected]>
Co-authored-by: Copilot App <[email protected]>
@danielmeppiel

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_now

Cursor universal rules now emit native alwaysApply:true -- all five prior follow-ups folded, panel unanimous, CI green.

panel-mode=delta; personas=doc-writer,test-coverage-expert,devx-ux-expert,oss-growth-hacker,apm-ceo

cc Ching Wei Kang (@WilliamK112) Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The delta (0c5d527..685bd3e) folds exactly the five follow-ups from the previous advisory on this PR. The redundant Cursor paragraph in instructions-and-agents.md is gone; the table row is the single source of truth, with a short reinstall note below the table and a clause saying keyless Cursor rules are chosen from description. The CHANGELOG line now leads with the user-facing change. The targets-matrix Cursor bullet is split into three scannable cases. The e2e test compares all nine renders in one dict, so a failure names every mismatched case. No src/ change in the delta, so the python-architect's prior clean review stands.

All four re-spawned panelists return zero findings. CI is green at this head, the branch contains current main, and the contributor credit to Ching Wei Kang (@WilliamK112) is intact.

Aligned with: portable by manifest -- author declares applyTo once and each target gets its native form; multi-harness -- Cursor emits native alwaysApply, other targets unaffected; pragmatic as npm -- no new author fields, flags, or migration steps, and reinstall converges by lock-hash match; OSS community -- Ching Wei Kang (@WilliamK112)'s contribution lands with every follow-up folded and no scope creep.

Panel summary

Persona B R N Takeaway
Doc Writer 0 0 0 All three prior findings resolved; nested bullets render correctly; no new doc issues.
Test Coverage Expert 0 0 0 Dict-equality assertion resolves the prior nit; no src change; coverage intact.
DevX UX Expert 0 0 0 Prior nit resolved; table stays the single source of truth with a clear reinstall note.
OSS Growth Hacker 0 0 0 CHANGELOG leads with the user benefit; targets-matrix scanning parity restored.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Recommendation

All five prior follow-ups are folded and confirmed by the originating panelists. No advisory items remain. Ready for Daniel Meppiel (@danielmeppiel) and Sergio Sisternes (@sergio-sisternes-epam) to review and land at their discretion.

Folded in this run

  • (merge) Merged current main; kept main's comma-scalar Cursor globs: and added only the universal branch; renumbered the amendment to req-tg-018 / Section 8.5.10 / 0.1.58 (proposed); regenerated CONFORMANCE; moved the CHANGELOG line to Unreleased -- resolved in 3329039.
  • (panel 2026-08-18) Extract _is_universal_glob predicate -- resolved in 3329039.
  • (panel 2026-08-18) Document the absent/empty applyTo case -- resolved in 3329039.
  • (scope record) Cursor target docs and apm-usage guide describe the mapping -- resolved in 3329039.
  • (scope record) Installed-CLI nine-case test at project and user scope, idempotent reinstall, replacement of prior globs: ** output, handwritten rules preserved -- resolved in 0c5d527.
  • (panel) Deduplicate the author-page Cursor paragraph; note that keyless rules are chosen from description; split the targets-matrix bullet; lead the CHANGELOG with the user change; one dict assertion for all nine e2e cases -- resolved in 685bd3e.

Copilot signals reviewed

  • src/apm_cli/integration/instruction_integrator.py:492 -- LEGIT: non-ASCII arrow in the docstring (resolved in 3329039; the merged docstring is ASCII).
  • tests/spec_conformance/test_manifest_reqs.py:817 -- LEGIT: truncated spec needle (resolved in 3329039; the new req-tg-018 needles pin the full phrases).

Regression-trap evidence (mutation-break gate)

  • tests/integration/test_cursor_always_apply_e2e.py (project, user) and test_consumer_maps_cursor_universal_instruction_to_always_apply[scalar|padded|list] -- removed the _is_universal_glob branch; 5 tests FAILED as expected; guard restored.

Lint contract

Ruff check and format (src/, tests/, the architecture linter scripts, and the Windows probe entry), pylint R0801, scripts/lint-auth-signals.sh, and scripts/lint-architecture-boundaries.sh were all silent at 685bd3e.

CI

At 685bd3e, CI, Merge Gate, CodeQL, NOTICE Drift Check, Deploy Docs, PR eligibility evidence, and license/cla all passed. Spec conformance (including the CONFORMANCE regeneration diff gate) passed at 0c5d527; spec files are unchanged since then. 0 CI fix iterations were needed.

Mergeability status

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#2030 685bd3e ship_now 2 6 0 2 green MERGEABLE BLOCKED pending required review

Convergence

2 outer iterations; 2 Copilot rounds (drained, no new output). Final panel stance: ship_now. 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-review-worker. This comment is AI-generated and may contain errors.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit c2c2e0d into microsoft:main Nov 12, 2026
25 checks passed
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 12, 2026
Clean merge of #3644 and #2030; no lockfile or autopilot package
changes.

Co-authored-by: sergio-sisternes-epam <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 12, 2026
…tterns

Resolve Appendix D conflict: main took 0.1.58 for req-tg-018 (#2030); this PR's req-pl-018 clause (g) amendment becomes 0.1.59, count 138 (133 MUST, 5 SHOULD).

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI command surface, flags, help text (cross-cutting). status/deferred Not invited for implementation now; no release commitment. triage/recommended Automated advice completed; not human scope approval. type/feature New capability, new flag, new primitive.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title: [FEATURE] Support mapping instruction frontmatter to Cursor alwaysApply: true

4 participants