Repository navigation
Description
Proposals are welcome before implementation. For substantive changes, wait
for a responsible human maintainer to approve the scope and identify a review
contact. An automated recommendation, label alone, or silence is not approval.
See Contributing.
Is your feature request related to a problem? Please describe.
#3723 repaired two 0.36.0 release-gate regressions with local fixes. The review panel (#3723 (comment)) and a Copilot review comment found that each local fix copies a decision that should have a single owner:
- Deployed-hash path keys.
remove_stale_deployed_files(src/apm_cli/integration/cleanup.py) now converts backslashrecorded_hasheskeys to forward slashes, because Windows callers passed native-separator keys, the hash check never matched, and hook cleanup removed nothing. About 30 other call sites already do their own.replace("\\", "/"). Nothing guarantees thatdeployed_file_hasheskeys are POSIX where they are written and read, so each new caller can bring the bug back. - Skipping an unclaimed, populated skill directory.
find_unmanaged_conflicts(src/apm_cli/integration/skill_preflight.py,user_skill_dir) copies the guard inskill_integrator.py(~line 1248) that stops materialization writing into such a directory. The native and sub-skill routes use different ownership rules (session ownership, the managed set used for collision checks, and cases where the same package owns the skill name under another target), and the copy does not follow them exactly. Preflight can therefore still refuse a claimed file in a directory that materialization would skip. This fails closed, with no data loss, but it is a false refusal.
Describe the solution you'd like
- A
posix_path_key()helper, or the equivalent, inutils/paths.pybesideportable_relpath, used whereverdeployed_file_hashesis written and read. Callers drop their own conversions, and a boundary lint flags new ad-hoc.replace("\\", "/")calls on path keys. - A route-aware decision such as
is_unclaimed_user_skill_dir(...)inskill_support.py, called by both preflight and materialization. It must handle the lockfile root and same-run ownership correctly. Add tests that the two callers agree in user scope and across targets, and a check that both delegate to the shared decision.
Done when each decision has one owner, guarded by a regression test and a static boundary check, per .github/instructions/architecture.instructions.md.
Describe alternatives you've considered
Keep the local fixes from #3723. They are correct for the release, but they leave both decisions in two places each.
Additional context
Follow-up from #3723 (release-gate repair for 0.36.0). Related: #3672, #3709, #3649.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: Give two decisions a single owner. (1) Add a posix_path_key() helper in src/apm_cli/utils/paths.py beside portable_relpath, use it wherever deployed_file_hashes keys are written and read (including remove_stale_deployed_files in src/apm_cli/integration/cleanup.py), drop the callers' ad-hoc .replace("\", "/") conversions on those keys, and add a boundary check that flags new ad-hoc conversions on hash path keys. (2) Add one route-aware unclaimed-user-skill-directory decision in src/apm_cli/integration/skill_support.py, called by both find_unmanaged_conflicts in src/apm_cli/integration/skill_preflight.py and the guard in src/apm_cli/integration/skill_integrator.py, handling the lockfile root and same-run ownership.
Done when: each decision has one owner guarded by a regression test and a static boundary check per .github/instructions/architecture.instructions.md (with a MutationCase in tests/integration/test_architecture_owner_rule_mutations.py); tests show preflight and materialization agree in user scope and across targets; lockfiles written before and after the change are byte-identical on POSIX and Windows.
Out of scope: any change to the lockfile schema or recorded key format; any widening of where materialization writes; changes to deletion authority or receipt rules (req-lk-024); unrelated .replace calls that are not hash path keys.
Review contact: Daniel Meppiel (@danielmeppiel)
danielmeppiel commentedon Nov 24, 2026
Thanks for filing this. To keep follow-up work in one place, this item is now tracked in the area backlog list #5315, which links back here, and its scope notes stay readable on this issue. Closing this issue as a duplicate of that list.