Skip to content

fix(upgrade): loop-* skill copy doubles the skills/ path segment - #63

Merged
codejunkie99 merged 1 commit into
codejunkie99:masterfrom
diazMelgarejo:fix/loop-skill-copy-path-doubling
Aug 6, 2026
Merged

fix(upgrade): loop-* skill copy doubles the skills/ path segment#63
codejunkie99 merged 1 commit into
codejunkie99:masterfrom
diazMelgarejo:fix/loop-skill-copy-path-doubling

Conversation

@diazMelgarejo

@diazMelgarejo diazMelgarejo commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

_new_loop_assets() in harness_manager/upgrade.py computes each new loop-* skill's destination as dst_skills / src.relative_to(src_agent). src.relative_to(src_agent) already starts with skills/ (src_agent is .agent/, not .agent/skills/), and dst_skills is already .agent/skills/ — so every genuinely-new loop-* skill lands at .agent/skills/skills/loop-x/SKILL.md instead of .agent/skills/loop-x/SKILL.md. Both upgrade --dry-run's own report and the real file copy are wrong.

This went unnoticed because the existing test coverage in tests/test_loop_integrations.py only ever pre-seeds loop-triage at the destination before calling upgrade() — so it exercises the "already exists, skip" branch and never the fresh-copy branch that actually builds the destination path.

Fix

dst_agent / src.relative_to(src_agent), matching the sibling non-loop skill-copy block earlier in the same function (_plan(), ~15 lines above), which already gets this right.

Tests

New: test_upgrade_copies_missing_loop_skills_to_the_correct_path — calls upgrade() against a fresh target with none of the loop-* skills pre-seeded, and asserts each lands at the correct (non-doubled) path.

Confirmed via git stash that this test fails on the old code (asserts the doubled path is absent) and passes on the fix.

python3 -m pytest tests/test_loop_integrations.py -v
# 5 passed

Note

Fix duplicate skills/ path segment when copying loop-* skill files during upgrade

In _new_loop_assets, the destination path for loop-* skill copy actions was built using dst_skills / src.relative_to(src_agent), which produced .agent/skills/skills/loop-*/.... The fix uses dst_agent / src.relative_to(src_agent) instead, targeting the correct .agent/skills/loop-*/... path. A new integration test in test_loop_integrations.py asserts the correct destination and confirms no .agent/skills/skills directory is created.

Macroscope summarized 312f132.

_new_loop_assets() computed each new loop-* skill's destination as
dst_skills / src.relative_to(src_agent) -- but src.relative_to(src_agent)
already starts with "skills/" (src_agent is .agent/, not .agent/skills/),
and dst_skills is already .agent/skills/. Result: every genuinely-new
loop-* skill lands at .agent/skills/skills/loop-x/SKILL.md instead of
.agent/skills/loop-x/SKILL.md -- both the CLI's own --dry-run report and
the real copy were wrong, silently, since no existing test exercised a
fresh (non-pre-seeded) loop-* skill destination.

Fix: dst_agent / src.relative_to(src_agent), matching the sibling
non-loop skill-copy block earlier in the same function (line ~84), which
already gets this right.

New test: test_upgrade_copies_missing_loop_skills_to_the_correct_path.
Confirmed it fails on the old code (asserts the doubled path is absent)
and passes on the fix.
@diazMelgarejo

Copy link
Copy Markdown
Contributor Author

Related, independent PRs — no dependency on this one:

This PR (the upgrade.py path-doubling fix) is unrelated in code but came out of the same review pass — surfaced while checking upgrade --dry-run's output for the other three.

cc @codejunkie99 — happy to answer questions on any of these, or squash/reorder however's easiest to review.

@codejunkie99
codejunkie99 merged commit a592c16 into codejunkie99:master Aug 6, 2026
1 check passed
codejunkie99 pushed a commit that referenced this pull request Aug 6, 2026
Patch release covering #60, #61, #62, #63: superseded-lesson filtering in
recall, the doubled skills/ path in upgrade's loop-skill copy, UTF-8 I/O in
learn.py, and a leaked file handle.

Collapses the stacked per-version README history (v0.9.0 through v0.18.0)
into a single pointer at CHANGELOG.md, and relaxes the onboarding docs test
from an exact version pin to the 0.19.x series so patch releases keep
asserting the loop docs and sandbox caveat without editing the assertion
each time.
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.

2 participants