-
Notifications
You must be signed in to change notification settings - Fork 148
Cowork internal refactors — DRY and hot-path cleanup #922
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.Multi-target deploy spec, target directory creation, agent surface routing.enhancementDeprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.experimentalstatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).type/refactorInternal restructure, no behavior change.Internal restructure, no behavior change.
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.Multi-target deploy spec, target directory creation, agent surface routing.enhancementDeprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.experimentalstatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).type/refactorInternal restructure, no behavior change.Internal restructure, no behavior change.
Type
Projects
Status
Done
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.
SkillIntegratorinlines dynamic-root routing 3xFile:
src/apm_cli/integration/skill_integrator.py:666-667, 778-779, 838-839Three call sites open-code
if target.resolved_deploy_root is not None: ...instead of calling thetarget.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 insync_remove_filesFile:
src/apm_cli/integration/base_integrator.pyaround lines 410 and 420Each call hits
apm configread + 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 bypassingupdate_config()File:
src/apm_cli/config.py:129-140, 178-189Two 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 callsupdate_config(); keep the two public wrappers as one-liners.Acceptance criteria
SkillIntegratorsites calltarget.deploy_path(...).sync_remove_filesresolves the cowork root once per sync invocation.update_config().update_configcode path in both unset helpers./cc panel review: #913