Skip to content

Refactor 922 cowork cleanups#1667

Open
abhinavgautam01 wants to merge 4 commits into
microsoft:mainfrom
abhinavgautam01:refactor-922-cowork-cleanups
Open

Refactor 922 cowork cleanups#1667
abhinavgautam01 wants to merge 4 commits into
microsoft:mainfrom
abhinavgautam01:refactor-922-cowork-cleanups

Conversation

@abhinavgautam01
Copy link
Copy Markdown
Contributor

Description

Cleans up the remaining accepted cowork internal refactor items from #922. This routes skill deployment path construction through TargetProfile.deploy_path(...), preserves primitive deploy-root overrides such as .agents/skills and makes config unset helpers use the shared update_config() read-modify-write path.

The sync_remove_files cowork-root caching item from #922 was already present on current main, so this PR does not touch base_integrator.py.

Fixes #922

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation run:

uv run --python 3.12 ruff check src/apm_cli/config.py src/apm_cli/integration/targets.py src/apm_cli/integration/skill_integrator.py tests/unit/
test_config.py tests/unit/integration/test_copilot_cowork_target.py tests/unit/integration/test_skill_integrator_hermetic.py tests/unit/integration/
test_skill_integrator_phase3w4.py
uv run --python 3.12 pytest tests/unit -q
git diff --check

Results:

  • Ruff passed
  • Full unit suite: 16607 passed, 2 skipped, 21 xfailed, 19 warnings, 40 subtests passed
  • Diff check passed

Note: uv run --python 3.12 pytest -q exited 0 locally, but integration/live suites were environment-gated (26704 skipped, 173 deselected), so the meaningful broad local signal is the full unit suite above.

Spec conformance (OpenAPM v0.1)

If this PR changes behaviour that an OpenAPM v0.1 req-XXX covers,
confirm the three-step ritual (see CONTRIBUTING.md "Adding or
changing a normative requirement"):

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed anchor + prose + Appendix C
    row).

  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.

  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.

  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.

  • N/A -- this PR does not change OpenAPM-observable behaviour.

Copilot AI review requested due to automatic review settings June 4, 2026 16:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR centralizes config key removal through the update_config() write path and extends target deployment path resolution to support primitive-specific deploy_root overrides (used by skills), updating skill integration logic and tests accordingly.

Changes:

  • Add remove_keys support to update_config() and route _unset_config_key() through it.
  • Extend TargetProfile.deploy_path() with an optional primitive parameter to honor primitive-level deploy_root/subdir.
  • Refactor skill integrator path building to use target.deploy_path(...) and expand tests for these behaviors.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unit/test_config.py Adds unit tests ensuring unset helpers call the shared update_config() path.
tests/unit/integration/test_skill_integrator_phase3w4.py Updates test target construction to provide a deploy_path() matching new primitive-aware behavior.
tests/unit/integration/test_skill_integrator_hermetic.py Same as above for hermetic integration coverage.
tests/unit/integration/test_copilot_cowork_target.py Adds coverage for primitive deploy-root override behavior on the copilot target.
src/apm_cli/integration/targets.py Implements deploy_path(..., primitive=...) and removes prior Path typing workarounds.
src/apm_cli/integration/skill_integrator.py Replaces bespoke “skills root” resolution with TargetProfile.deploy_path().
src/apm_cli/config.py Adds remove_keys to update_config() and routes unsets through it.

Comment thread src/apm_cli/integration/targets.py
Comment thread src/apm_cli/integration/targets.py Outdated
Comment thread tests/unit/integration/test_skill_integrator_phase3w4.py Outdated
Comment thread tests/unit/test_config.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cowork internal refactors — DRY and hot-path cleanup

2 participants