Repository navigation
Description
Follow-up to #913. Surfaced by the APM Expert Review Panel (Python Architect specialist). All MEDIUM-severity maintenance items, no user-facing impact. CEO arbitration: acceptable as follow-ups, no release gate.
1. SkillIntegrator inlines dynamic-root routing 3x
File: src/apm_cli/integration/skill_integrator.py:666-667, 778-779, 838-839
Three call sites open-code if target.resolved_deploy_root is not None: ... instead of calling the target.deploy_path() accessor the PR itself introduced. This re-duplicates the very abstraction the target profile is meant to provide.
Fix: route all three sites through target.deploy_path(...).
2. resolve_cowork_skills_dir() called twice per entry in sync_remove_files
File: src/apm_cli/integration/base_integrator.py around lines 410 and 420
Each call hits apm config read + OneDrive glob. In a sync loop this compounds.
Fix: resolve once at the top of the cowork branch in sync_remove_files, reuse the value.
3. unset_temp_dir() / unset_cowork_skills_dir() copy-paste bypassing update_config()
File: src/apm_cli/config.py:129-140, 178-189
Two near-identical unset helpers, both re-implementing the read-modify-write pattern instead of calling update_config(). Maintenance trap for any future config-file format change.
Fix: consolidate into _unset_key(key) that calls update_config(); keep the two public wrappers as one-liners.
Acceptance criteria
- All three
SkillIntegratorsites calltarget.deploy_path(...). -
sync_remove_filesresolves the cowork root once per sync invocation. - Both unset helpers delegate to a single implementation that uses
update_config(). - Existing tests remain green; add a regression test for the
update_configcode path in both unset helpers.
/cc panel review: #913
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Cowork internal refactors — DRY and hot-path cleanup[/-][+]VOID[/+][-]VOID[/-][+]Cowork internal refactors — DRY and hot-path cleanup[/+]3 remaining items
github-actions commentedon Apr 27, 2026
Triage decision
accept
Proposed labels
Milestone
null
Suggested next action
Open a PR touching
skill_integrator.py,base_integrator.py, andconfig.pyto address all three items in one atomic changeset per the acceptance criteria.Suggested issue comment
Per-lens notes (collapsed)
DevX UX Expert -- User-Need Reviewer
No user-facing surface change. All three items are internal code-quality improvements under the experimental cowork flag. Zero impact on CLI commands, flags, output, or error messages. Acceptance criteria explicitly confirms "no user-facing impact."
Supply Chain Security Expert -- Risk-Surface Reviewer
No risk-surface implication. The refactors route through existing safe abstractions:
target.deploy_path()(validated path accessor),update_config()(controlled config write). No lockfile, auth, marketplace, or MCP trust surface is touched.OSS Growth Hacker -- Contributor-Tone Reviewer
Not activated -- sergio-sisternes-epam is a known collaborator with multiple prior contributions to microsoft/apm; no first-time-contributor tone tuning needed.
Python Architect -- Architecture Reviewer
All three items are correctly identified DRY violations. Item 1 (routing through
target.deploy_path()) removes open-coded conditional chains; item 2 (cachingresolve_cowork_skills_dir()) eliminates O(N) compound config reads in a sync loop; item 3 (consolidating unset helpers) prevents future config-format maintenance traps. No cross-module design decision required -- all fixes are contained within the three named files. Recommend landing as a single PR for atomic review.Doc Writer -- Documentation Reviewer
Not activated -- pure internal refactor with no new CLI surface, no new config key, and no user-visible behavior change. No documentation update required for this changeset.
APM CEO -- Triage Arbiter
Clean accept. These three maintenance items are the textbook follow-up shape: specific, bounded, non-blocking, with clear acceptance criteria. They sit in the "recommended but non-blocking" bucket of the cowork GA exit criteria in #933. Land them when convenient; no milestone pressure until #925 clears the security gate.
danielmeppiel commentedon Jun 25, 2026
Accepted -- scoped to item 1 only (the bounded DRY / hot-path cleanup in the cowork internal path). The broader refactor items that drifted onto this issue are out of scope for this acceptance; if they still matter, please split them into their own issues so each carries its own design and test surface.
Constraint for the implementer: this is a behavior-preserving refactor. It must ship with the existing test suite green and no public CLI/manifest surface change -- a pure internal tidy. Anything that changes observable behavior gets kicked back to a feature issue.
refactor(cowork): DRY internal hot-path cleanup (closes microsoft#922) (