Repository navigation
fix(copilot): keep Copilot modular instructions split at user-scope since supported - reverts #1619 - #2317
Conversation
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
This PR reverts the Copilot user-scope instructions behavior introduced in #1619 by restoring modular instruction deployment for the Copilot target at user scope (deploying *.instructions.md files under ~/.copilot/instructions/ instead of concatenating into ~/.copilot/copilot-instructions.md).
Changes:
- Remove the Copilot user-scope instruction concat override from the Copilot
TargetProfileand revert to the standardgithub_instructionsmapping. - Delete the concat integration/sync implementation from
InstructionIntegratorand simplify sync cleanup back to directory-based removal. - Update unit/integration tests and the targets matrix docs to reflect modular user-scope Copilot instruction deployment.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/integration/test_scope_integration.py | Updates expectations for Copilot user-scope instructions mapping (github_instructions). |
| tests/unit/integration/test_scope_install_uninstall.py | Updates user-scope install assertions to expect .copilot/instructions/ files rather than a single concat file. |
| tests/unit/integration/test_data_driven_dispatch.py | Adjusts for-scope filtering/mapping expectations for Copilot user-scope instructions. |
| tests/unit/install/test_install_copilot_user_instructions.py | Reworks acceptance tests to validate per-file deployment under .copilot/instructions/ and frontmatter preservation. |
| tests/integration/test_integration_runtime_coverage.py | Removes coverage tests specific to the deleted concat helpers and concat integration path. |
| src/apm_cli/integration/targets.py | Removes Copilot user-scope primitive override; updates Copilot user-scope behavior comments. |
| src/apm_cli/integration/instruction_integrator.py | Removes concat integration path and collapses sync cleanup logic to directory-prefix behavior. |
| docs/src/content/docs/reference/targets-matrix.md | Updates Copilot user-scope documentation to describe modular instructions under ~/.copilot/instructions/. |
Comments suppressed due to low confidence (1)
src/apm_cli/integration/instruction_integrator.py:271
- sync_for_target() now only removes managed files under "//". If a user previously installed Copilot user-scope instructions with the old concat format, the lockfile can still contain ".copilot/copilot-instructions.md" (root file), and an uninstall with this code will never match the new prefix, leaving that legacy file behind. Consider adding a small legacy cleanup pass for that specific path when uninstalling copilot at user scope.
return self.sync_remove_files(
project_root,
managed_files,
prefix=prefix,
legacy_glob_dir=legacy_dir,
9850cbd to
0a8af14
Compare
0a8af14 to
55cce80
Compare
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)
src/apm_cli/integration/instruction_integrator.py:264
- Legacy cleanup: now that Copilot user-scope instructions deploy under
.copilot/instructions/(prefix${root}/${subdir}/),sync_for_target()will no longer remove the previously-managed legacy file.copilot/copilot-instructions.mdcreated by the reverted concat implementation (#1619). That path does not match the new prefix, andBaseIntegrator.partition_managed_files()also routes managed paths only by${root}/${subdir}/prefixes (so.copilot/copilot-instructions.mdwon't even land in theinstructionsbucket during uninstall). This can leave a stalecopilot-instructions.mdbehind after uninstall/cleanup and potentially orphaned lockfile entries.
effective_root = mapping.deploy_root or target.root_dir
prefix = f"{effective_root}/{mapping.subdir}/"
legacy_dir = project_root / effective_root / mapping.subdir
if mapping.format_id == "cursor_rules":
legacy_pattern = "*.mdc"
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 2 | 1 | Clean special-case removal with one data-modeling gap (generated_files still declared on the profile) and a missing migration path for existing managed files. |
| CLI Logging Expert | 0 | 0 | 1 | Output path change is factually correct; no migration noise needed for a revert to the originally-supported layout. |
| DevX UX Expert | 0 | 2 | 1 | Missing migration path leaves stale concat file on existing users' machines after upgrade. |
| Supply Chain Security Expert | 0 | 1 | 1 | No exploitable regression; standard path guards preserved. Minor concern about orphaned user-scope concat file from prior installs. |
| OSS Growth Hacker | 0 | 2 | 1 | High-signal community PR that simplifies the Copilot UX and deserves a release beat. |
| Doc Writer | 0 | 1 | 3 | The diff is accurate and well-scoped; one minor prose gap and a stale cross-reference in the same file are worth a follow-up. |
| Test Coverage Expert | 0 | 1 | 0 | Modular user-scope deploy well-covered at unit tier; missing assertion on generated_files=() guard at user scope. |
| Performance Expert | 0 | 0 | 2 | Net positive: removes an O(n) read+regex+concat loop and replaces it with the standard O(n) per-file write path that is strictly cheaper per iteration. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [DevX UX Expert] Add one-time cleanup of orphaned
~/.copilot/copilot-instructions.mdcontaining the APM sentinel -- Three panelists independently flagged this. Users upgrading from the concat era will have a stale file that Copilot CLI still reads, causing duplicate or outdated instructions. - [Test Coverage Expert] Assert
copilot.for_scope(user_scope=True).generated_files == ()in the existing user-scope test suite -- Missing regression trap on the behavioral guard that prevents lockfile tracking leakage at user scope. One-line assertion, high defensive value. - [Python Architect] Replace the string-equality name check in
for_scope()with a declarative field onTargetProfile-- Theif self.name == 'copilot'guard is a special case that should be expressed via the existingunsupported_user_primitivesmechanism or a newuser_generated_filesfield. - [Doc Writer] Add user-scope generated path to the file-conventions block in
targets-matrix.md-- The reference page now describes project-scope output but omits the analogous user-scope path, creating an incomplete mental model for readers. - [OSS Growth Hacker] Frame CHANGELOG entry as a UX win and credit kilianpaquier in release notes -- Positions the change as user-facing simplification rather than internal housekeeping; signals community PR velocity.
Architecture
classDiagram
direction LR
class TargetProfile {
<<ValueObject>>
+name str
+root_dir str
+user_root_dir str
+primitives dict
+generated_files tuple
+unsupported_user_primitives frozenset
+user_primitive_overrides dict
+for_scope(user_scope) TargetProfile
}
class PrimitiveMapping {
<<ValueObject>>
+subdir str
+extension str
+format_id str
+deploy_root str
+output_compare bool
}
class InstructionIntegrator {
+integrate()
+remove_files_for_target()
-_render_instruction()
-_deploy_plain_copy()
}
class BaseIntegrator {
<<Abstract>>
+sync_remove_files()
+check_collision()
}
BaseIntegrator <|-- InstructionIntegrator
TargetProfile *-- PrimitiveMapping : primitives
InstructionIntegrator ..> TargetProfile : reads profile
InstructionIntegrator ..> PrimitiveMapping : dispatches on format_id
class TargetProfile:::touched
class InstructionIntegrator:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["apm install -g"] --> B["InstructionIntegrator.integrate()"]
B --> C{"format_id in RULE_FORMATS?"}
C -->|Yes| D["_render_instruction() -- format transform"]
C -->|No| E["_deploy_plain_copy() -- verbatim deploy"]
D --> F["[FS] write_text_lf(target_path)"]
E --> F
F --> G["Return IntegrationResult"]
B --> H{"REMOVED: format_id == copilot_user_instructions?"}
H -.->|Was| I["REMOVED: _integrate_copilot_user_instructions()"]
style H stroke-dasharray: 5 5
style I stroke-dasharray: 5 5
A --> J["TargetProfile.for_scope(user_scope=True)"]
J --> K{"self.name == copilot?"}
K -->|Yes| L["Drop generated_files"]
K -->|No| M["Keep generated_files"]
L --> N["replace(self, root_dir=.copilot, generated_files=())"]
M --> N
Recommendation
Ship now. The PR is correct, safe, net-negative LOC, and community-authored. The orphaned-file cleanup and missing assertion are real gaps but neither blocks the behavioral correctness of this change. File a follow-up issue for the migration hook (highest priority) and the unit assertion (fast fix). Land this promptly to honor the community contribution velocity signal.
Full per-persona findings
Python Architect
-
[recommended]
generated_filesshould be empty on the profile or scoped viaunsupported_user_primitivesrather than a name-check infor_scope()atsrc/apm_cli/integration/targets.py:411
Theif self.name == "copilot":guard in for_scope() is a string-equality special case that violates the data-driven target model. The existingunsupported_user_primitivesmechanism or a newuser_generated_filesfield on TargetProfile would express this declaratively.
Suggested: Either (a) setgenerated_files=()on the profile and addcopilot-instructions.mdonly to a project-scope-specific field, or (b) add auser_generated_files: tuple[str, ...] | None = Nonefield defaulting togenerated_fileswhen None, and use it in for_scope(). Both eliminate the name check. -
[recommended] No migration/cleanup for the legacy
~/.copilot/copilot-instructions.mdfile APM previously managed atsrc/apm_cli/integration/instruction_integrator.py
Users who installed packages with the concat approach now have a stale copilot-instructions.md. After this PR,apm install -gwill not touch or remove that file. A migration hook or at minimum a deprecation warning during next install would prevent user confusion.
Suggested: Add a one-time cleanup in integrate() or a pre-install migration step that detects the APM sentinel header in ~/.copilot/copilot-instructions.md and removes or renames it, logging a diagnostic message. -
[nit]
generated_filesdeclaration on the copilot profile is now dead at user scope -- the comment says 'compile output' but the tuple still exists for project scope atsrc/apm_cli/integration/targets.py:522
The field serves project-scope compile tracking, so keeping it is correct. But the comment on line 407-409 inside for_scope() should cross-reference line 522 to avoid future confusion.
CLI Logging Expert
- [nit] Count jump from '1 instruction(s)' to '11 instruction(s)' may surprise users on first run after upgrade
Users who relied on the old concat approach saw '1 instruction(s) integrated' for 11 source files. Post-revert they see '11 instruction(s) integrated'. This is correct but a one-line verbose-only note like '[i] copilot user-scope now deploys per-file to ~/.copilot/instructions/' on the first install that hits the new path would smooth the transition.
DevX UX Expert
-
[recommended] No cleanup of legacy
~/.copilot/copilot-instructions.mdon reinstall
Users who ran pre-PR versions have an APM-managed ~/.copilot/copilot-instructions.md (identifiable by the sentinel). After this PR,apm install -gdeploys modular files but never removes the old concat file. User ends up with duplicate/stale instructions that Copilot CLI will still read.
Suggested: During user-scope copilot install, check for ~/.copilot/copilot-instructions.md containing the APM sentinel header. If found: (a) remove it automatically (it was APM-managed), or (b) emit a one-time warning with the exactrmcommand. Option (a) is safest since the sentinel proves APM ownership. -
[recommended]
apm uninstall -g --target copilotshould also clean the legacy concat file
The uninstall path only looks for files matching the newinstructions/*.instructions.mdprefix. The old single-file path is orphaned from the ownership model, so uninstall will not find or remove it either.
Suggested: Add the old concat path to the uninstall sweep when the sentinel is detected. -
[nit] Consider a CHANGELOG migration note for existing global-install users
Users scanning the changelog for breaking changes would benefit from a one-liner about deleting the old file and the new path.
Supply Chain Security Expert
-
[recommended] Orphaned
~/.copilot/copilot-instructions.mdfrom prior concat installs may persist with stale content
The removed sync path no longer tracks or cleans up the old file. If it contained content from a since-removed or compromised package, the stale instructions persist silently in the user's Copilot context.
Suggested: Add a one-time migration that detects the APM-managed sentinel and removes or renames it. -
[nit] Provenance markers lost at user scope -- no per-file equivalent of
apm:source:pkg_source
The concat file embedded HTML comment provenance markers per package section. The new per-file deploy relies on filename-based attribution only. This is a minor observability regression.
OSS Growth Hacker
-
[recommended] CHANGELOG entry should frame this as a UX win, not just a revert
Users care that modular instructions now work at user scope -- not that internal workaround code was removed. -
[recommended] Quickstart or Copilot guide should mention user-scope parity
The mental-model simplification ('user scope mirrors project scope exactly') removes a friction point that confused Copilot-first adopters. -
[nit] Acknowledge community contributor in release notes
kilianpaquier fixing a real UX gap and deleting 350 lines is exactly the contributor signal that attracts more contributors.
Auth Expert -- inactive
No auth-relevant files changed; PR only modifies instruction file deploy path at user scope.
Doc Writer
-
[recommended] File-conventions block still shows
.github/copilot-instructions.mdas generated output with no user-scope analogue atdocs/src/content/docs/reference/targets-matrix.md
The updated prose describes~/.copilot/instructions/for individual files but the nearby file-conventions bullet has no user-scope generated note.
Suggested: Under the- **File conventions.**bullet for copilot, add:user-scope instructions: ~/.copilot/instructions/<name>.instructions.md -
[nit] 'mirroring the project-scope layout' is slightly ambiguous -- spell out
.github/instructions/
Suggested: Change to 'mirroring the.github/instructions/project-scope layout' for explicitness. -
[nit] Reference URL change is correct and more specific; positive accuracy fix.
-
[nit] No other doc page contains surviving old concat wording; corpus is clean.
Test Coverage Expert
- [recommended] No test asserts
copilot.for_scope(user_scope=True).generated_files == ()atsrc/apm_cli/integration/targets.py
The PR adds a guard that clears generated_files at user scope to preventcopilot-instructions.mdleaking into user-scope lockfile tracking. grep'd tests for 'generated_files' -- zero hits in user-scope tests. A one-line assertion in the existing test would defend this.
Suggested: Addassert user_profile.generated_files == ()toTestCopilotUserScopeTargetProfile.test_for_scope_user_instructions_uses_modular_formator as a new test.
Proof (missing):tests/unit/install/test_install_copilot_user_instructions.py::test_for_scope_user_generated_files_empty-- proves: User-scope copilot profile does not leak project-scope generated file into lockfile tracking [DevX]
assert user_profile.generated_files == ()
Performance Expert
-
[nit] Marginal wall-time improvement on multi-package Copilot user-scope installs
The deleted _integrate_copilot_user_instructions read the target file, ran a regex finditer, and rewrote the whole file per package. Savings are real but small in absolute terms (sub-100ms for typical workloads). -
[nit] No new O(n^2) patterns introduced
The for_scope() change adds a single O(1) conditional and a tuple reassignment. All paths remain linear in the number of instruction files.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
0c41d97 to
b6141ce
Compare
|
Took into account:
Do you want me to provide an orphaned removal implementation for older managed user-scope copilot-instructions.md ? EDIT : Per my testing, orphaned copilot-instructions.md is already removed during upgrade (see my terminal proofs in PR description) |
b6141ce to
c0636e6
Compare
adbe7d5 to
fbac8c3
Compare
PR triage recommendationready-for-review Recommendation only, not merge or scope approval. A responsible Linked issue#650 -- CLOSED, labelled No auto-defer: a same-repo linked issue carries Proposed classificationPR currently has no type/area/theme labels. Useful allowlisted
Conflict to name, not replace: #650 is Processing: Suggested next actionWait for human review from the CODEOWNERS already requested. Suggested PR commentThanks @kilianpaquier -- this is a clear, bounded follow-up to #650.
#650 was accepted and then closed when #1619 shipped user-scope
Copilot instructions via a concatenated `~/.copilot/copilot-instructions.md`.
On the issue, maintainers already called that concat an antipattern.
Your PR (and the GitHub docs you cited) say Copilot now loads modular
`~/.copilot/instructions/**/*.instructions.md`, so reverting the
special case is in line with that direction.
An advisory review panel already posted `ship_with_followups` here.
You answered the generated_files test and docs follow-ups, and you
showed the concat file being cleaned on upgrade. That is useful
evidence; it is not maintainer approval.
This comment is classification only. It does not accept, assign, or
merge the work. CODEOWNERS remain @danielmeppiel and
@sergio-sisternes-epam (already requested). The branch currently
conflicts with `main`, so a rebase will make human review easier. |
|
Thanks kilianpaquier for the Copilot user-scope modular instructions work on this PR. Status: the branch still has merge conflicts with This path does not approve or merge. Generated by autopilot-pr-ready-takeover-steward. This comment is AI-generated and may contain errors. |
|
Thanks for the PR, kilianpaquier — and for keeping Copilot modular instructions split at user-scope now that it is supported. This branch currently conflicts with Delivery is taking the conflict from here: rebasing onto the latest base while keeping your authorship and preferring your branch ( I will follow up on this thread with the outcome. Generated by autopilot-pr-ready-takeover. This comment is AI-generated and may contain errors. |
|
Follow-up on the rebase attempt: Delivery rebased Per policy I am not hand-merging that conflict from here. Next step is either a conflict-resolution pass with explicit authorization, or an update from kilianpaquier on that file against current Generated by autopilot-pr-ready-takeover. This comment is AI-generated and may contain errors. |
…ince supported - microsoft#1619 Signed-off-by: kilianpaquier <[email protected]> Co-authored-by: Copilot <[email protected]>
fbac8c3 to
e978271
Compare
|
kilianpaquier — short update: the base conflict on GitHub now reports the PR as mergeable again (checks may still be catching up). Thanks again for the work here. Generated by autopilot-pr-ready-takeover. This comment is AI-generated and may contain errors. |
Keep `_strip_frontmatter` as a thin `_parse_frontmatter` wrapper so unit coverage of four-hyphen fences still passes after removing the concat path. Point policy/lifecycle unicode fixtures at modular `.copilot/instructions/*.instructions.md` now that user-scope no longer tracks the legacy concat file in generated_files.
apm-spec-waiver: restore modular user-scope Copilot paths; no new OpenAPM-observable behaviour Co-authored-by: Copilot <[email protected]>
|
kilianpaquier — Spec Mode B update: Delivery added an empty commit on
Thanks for the modular user-scope Copilot work. Generated by autopilot-pr-ready-takeover. This comment is AI-generated and may contain errors. |
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 1 | 0 | 2 | Revert is clean; e2e tests still assert the old concat path. |
| Test Coverage Expert | 0 | 1 | 1 | Per-file deploy and generated_files covered; no upgrade-cleanup regression trap. |
| Doc Writer | 0 | 2 | 1 | targets-matrix updated; CHANGELOG, primitives-and-targets and audit pages are stale. |
| Devx Ux Expert | 0 | 1 | 1 | Layout mirrors project scope; "partial" label now under-explained. |
| Supply Chain Security Expert | 0 | 1 | 0 | Managed-files path safe; legacy glob can hit user-authored files. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [Python Architect] (blocking-severity) Update
test_local_uninstall_alias_e2e.pylines 262 and 484 (and the synthetic fixture attest_audit_primitive_contract.py:772) to the per-file path -- the only item with immediate CI-failure risk on the merge commit. - [Supply Chain Security Expert] Set
legacy_pattern=Noneforgithub_instructionsat user scope insync_for_target-- avoids deleting user-authored files when upgrading from old lockfiles. - [Doc Writer] Add the CHANGELOG entry, fix
primitives-and-targets.mdline 99, and drop the aggregate reference inaudit.md-- three verified stale references. - [Devx Ux Expert] Name the remaining gap behind
user_supported="partial"for Copilot (or drop the label) and align targets-matrix wording. - [Test Coverage Expert] Add a regression test that a legacy
.copilot/copilot-instructions.mdindeployed_filesis cleaned after the upgrade -- manual terminal proof does not survive refactors.
Architecture
classDiagram
direction LR
class TargetProfile {
<<Dataclass>>
+primitives dict
+generated_files tuple
+for_scope(user_scope) TargetProfile
}
class PrimitiveMapping {
<<ValueObject>>
+subdir str
+extension str
+format_id str
}
class InstructionIntegrator {
<<BaseIntegrator>>
+integrate_instructions_for_target()
+sync_for_target()
+_strip_frontmatter() str
}
class BaseIntegrator {
<<Abstract>>
+sync_remove_files()
}
InstructionIntegrator --|> BaseIntegrator
TargetProfile *-- PrimitiveMapping
InstructionIntegrator ..> TargetProfile
class TargetProfile:::touched
class InstructionIntegrator:::touched
classDef touched fill:#fff3b0,stroke:#d47600
flowchart TD
A["apm install -g --target copilot"] --> B["TargetProfile.for_scope(user_scope=True)"]
B --> D{"name == copilot?"}
D -- Yes --> E["generated_files = ()"]
D -- No --> F["generated_files unchanged"]
E --> H["integrate_instructions_for_target()"]
F --> H
H --> J["Deploy each file to ~/.copilot/instructions/name.instructions.md"]
H --> M["sync_for_target(): prefix ~/.copilot/instructions/, legacy glob *.instructions.md"]
style J fill:#fff3b0,stroke:#d47600
style M fill:#fff3b0,stroke:#d47600
Recommendation
The revert is sound and community-requested. Merge after confirming the two test_local_uninstall_alias_e2e.py assertions pass on the merge commit or are updated to the per-file path. File the legacy-glob edge case as a scoped follow-up (legacy_pattern=None for github_instructions at user scope). The doc fixes are low effort and can land in this PR or immediately after. CODEOWNERS (@danielmeppiel, @sergio-sisternes-epam) remain the deciding reviewers.
Full per-persona findings
Python Architect
- [blocking] Untouched e2e tests still assert on
.copilot/copilot-instructions.mdattests/integration/test_local_uninstall_alias_e2e.py:262
Lines 262 and 484 run a realapm install --global --target copilotand read the old concat file; per-file deploy never creates it.test_audit_primitive_contract.py:772uses the old path as a synthetic fixture.
Suggested: assert on.copilot/instructions/<name>.instructions.md. - [nit]
self.name == "copilot"check infor_scopefollows the claude/hermes precedent; a declarative field would be cleaner if a second consumer appears. - [nit]
_strip_frontmatternow has no production callers; kept as a thin wrapper for tests.
Test Coverage Expert
- [recommended] No regression-trap test for legacy
~/.copilot/copilot-instructions.mdcleanup on upgrade attests/unit/integration/test_scope_install_uninstall.py
Plant the legacy file, list it inmanaged_files, callsync_for_target, assert removal with zero errors. - [nit]
test_for_scope_user_generated_files_emptyis unit-tier; adequate for now.
Doc Writer
- [recommended] No CHANGELOG
[Unreleased]entry atCHANGELOG.md
The shipped feat: apm install -g deploys copilot instructions to ~/.copilot/copilot-instructions.md #1619 entry still describes concatenation. State whether the legacy file is removed on upgrade. - [recommended] Stale pages at
docs/src/content/docs/concepts/primitives-and-targets.md:99
Says instructions are project-scope only;reference/cli/audit.mdstill names the aggregate file. - [nit] Note legacy file handling in
targets-matrix.mdif cleanup is not guaranteed.
Devx Ux Expert
- [recommended]
user_supported="partial"for Copilot is under-motivated atsrc/apm_cli/integration/targets.py:557
The install warning says "Partially supported: copilot" without naming a gap. Set full support or list the unsupported primitive. - [nit] targets-matrix says "User scope. Partial." but the text names no limitation at
docs/src/content/docs/reference/targets-matrix.md:126.
Supply Chain Security Expert
- [recommended] Legacy glob fallback can delete user-authored files under
~/.copilot/instructions/atsrc/apm_cli/integration/instruction_integrator.py:554
Only whenmanaged_filesis None (old lockfiles). The managed-files path is safe.
Suggested:legacy_pattern=Noneforgithub_instructionsat user scope.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by PR Review Panel for #2317 · copilot · auto · 567 AIC · ⌖ 6.6 AIC · ⊞ 10K · ◷
|
Steward receipt restamping the GH Action panel for ready-lane gates (advisory only). Source: github-actions[bot] comment 5942549352 ( Panel summary
Parseable findings (restamped)
Advisory only. Not a merge gate or scope approval. Re-apply |
|
Thanks for the PR, kilianpaquier — and for the careful Copilot user-scope instructions split. Panel review left a required finding on this tip: a couple of e2e (and related) asserts still expect the legacy single-file No action needed from you unless you want to steer a different approach. Generated by autopilot-pr-ready-takeover. This comment is AI-generated and may contain errors. |
…ns (microsoft#2317) Panel-feedback follow-up for microsoft#2317, which restores modular Copilot instructions at user scope (~/.copilot/instructions/**/*.instructions.md, mirroring project-scope .github/instructions/) and clears generated_files for user-scope Copilot so the legacy concatenated copilot-instructions.md is no longer tracked there. Credit to @kilianpaquier for the original feature design. Required: - tests/integration/test_local_uninstall_alias_e2e.py: update the two global Copilot assertions that still pointed at the retired .copilot/copilot-instructions.md concat file to assert on the modular per-file .copilot/instructions/*.instructions.md paths instead, consistent with the project-scope pattern already used in the same file. - tests/integration/test_audit_primitive_contract.py: switch the user-scope tracked-metadata fixture path from .copilot/copilot-instructions.md to a modular .copilot/instructions/probe.instructions.md path. Soft (done): - CHANGELOG.md: [Unreleased] entry crediting @kilianpaquier for microsoft#2317. - docs/.../primitives-and-targets.md and docs/.../reference/cli/audit.md: replace stale 'prompts and instructions are project-scope only' / 'copilot-instructions.md aggregate' language with the modular user-scope instructions description. - src/apm_cli/integration/targets.py: short comment motivating user_supported="partial" for copilot now that instructions work at user scope but prompts/agents/skills/hooks/canvas still don't. - src/apm_cli/integration/instruction_integrator.py: harden the legacy-glob fallback in sync_for_target so Copilot's broad '*.instructions.md' legacy cleanup only applies to project scope (.github/instructions/, always APM-managed); user scope (.copilot/instructions/) now gets legacy_pattern=None, following the existing Claude/Windsurf/Kiro precedent, since other tools may also drop .instructions.md files into that shared user directory. - tests/unit/integration/test_scope_install_uninstall.py: new regression test proving a hand-authored file under .copilot/instructions/ survives an APM uninstall/sync cycle. Verified: full CI-mirror lint chain (ruff check, ruff format --check, pylint R0801, lint-auth-signals.sh) passes; targeted unit/integration suites pass (tests/unit/integration/ + test_audit_primitive_contract.py: 2181 passed); the two directly-touched e2e scenarios in test_local_uninstall_alias_e2e.py pass against a freshly built apm binary. The other two scenarios in that same e2e file (test_global_absolute_list_key_drives_update_and_uninstall, test_global_duplicate_alias_preserves_exact_path_survivor) fail in this sandbox both before and after this change -- confirmed pre-existing via git stash -- due to a tmp-dir/package-name collision ('Shared Package'/'Mixed Case Package' substrings leaking into CLI output paths) unrelated to this fix. Co-authored-by: Copilot <[email protected]> Co-authored-by: GitHub Copilot <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Revert is clean; prior e2e blocker fixed. |
| Test Coverage Expert | 0 | 1 | 0 | Legacy-file cleanup on upgrade/uninstall still has no regression trap. |
| Doc Writer | 0 | 0 | 0 | Prior drift items closed. |
| Supply Chain Security Expert | 0 | 0 | 0 | Legacy glob hardened for user scope; managed-files path safe. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top follow-ups
- [Test Coverage Expert] Add a regression test that a legacy
.copilot/copilot-instructions.mdlisted indeployed_filesis removed after the upgrade. The author's terminal proof shows install-time stale cleanup works; no test locks it in, and the Copilot reviewer raised the same gap twice. - [Python Architect] Uninstall with an old lockfile:
sync_for_targetnow matches only the.copilot/instructions/prefix, so a legacy.copilot/copilot-instructions.mdentry is not matched by uninstall-time cleanup. If the follow-up test above shows it is orphaned, add a one-line legacy-path cleanup for user-scope Copilot. If install-time cleanup already covers it, document that in the test and skip the code change. - [Python Architect, nit]
_strip_frontmatterhas no production callers and is kept as a test-only wrapper; fine for now, drop it when convenient.
Recommendation
Merge once the still-running CI jobs (Windows gate, Lifecycle Smoke) finish green and the two remaining test_local_uninstall_alias_e2e.py scenarios pass in CI. The legacy concat-file cleanup test is a low-effort follow-up and can land here or right after. CODEOWNERS (@danielmeppiel, @sergio-sisternes-epam) remain the deciding reviewers.
This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.
Generated by PR Review Panel for #2317 · copilot · auto · 58.9 AIC · ⌖ 6.48 AIC · ⊞ 10K · ◷
|
Steward receipt restamping the GH Action confirmation panel for ready-lane gates (advisory only). Source: github-actions[bot] comment 5944941385 ( Panel summary
Parseable findings (restamped)
Advisory only. Not a merge gate or scope approval. Re-apply Generated by apm-pr-cockpit. This comment is AI-generated and may contain errors. |
The Lifecycle Smoke (Linux) job on fix/copilot-user-scope-instructions has been hitting the hard 6-minute job wall-clock timeout even though the required pytest selection itself passes cleanly (233 passed, 1 skipped in ~340s/5:40 on this tip). This is a CI wall-clock budget cascade, not a failing assertion: the 6-minute cap originally had headroom for checkout/setup/sync/cleanup plus test time, but as the required selection has grown it now routinely approaches ~5:40 of pytest time alone, leaving too little room for the surrounding job overhead. Raise lifecycle-smoke's timeout-minutes from 6 to 8 in .github/workflows/ci.yml and update the adjacent rationale comment to explain why. Keep tests/quality/test_ci_topology.py's LIFECYCLE_SMOKE_MAX_TIMEOUT_MINUTES guard in lockstep (6 -> 8) in the same commit so the topology contract stays green and still enforces a hard, tight hang bound. No change to the pytest selection expression, markers, required-check membership, E2E opt-in, or hermetic prohibitions. Credit to @kilianpaquier for the original work on microsoft#2317; this commit only addresses the CI timeout cascade observed on its tip. Co-authored-by: GitHub Copilot <[email protected]>
00842df
into
microsoft:main
Description
Reverts changes introduced in #1619 since Copilot CLI (and VSCode Chat) support user-scope
~/.copilot/instructions/**/*.instructions.md.Fixes #650.
Type of change
Testing
Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual (see CONTRIBUTING.md "Adding or
changing a normative requirement"):
apm-spec-waiver: restore modular user-scope Copilot paths; no new OpenAPM-observable behaviour
Proof of tests
Current APM installed version
v0.24.1Local build of this branch: