Is content_hash intended to be install-scope-specific? (scope-dependent relative-link anchoring)
#2195
Unanswered
cffnpwr (cffnpwr)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
For skills containing relative links, the
deployed_file_hashesandcontent_hashchange with the install scope (project vs--global), even for the sameresolved_commit. This makes the lockfile non-portable across scopes, so I'd like to confirm whether that is the intended premise.Environment
Actual
When a skill contains an intra-package relative link (e.g.
SKILL.md→../../commands/foo.md), apm rewrites that link to be anchored at the deployment location during install (src/apm_cli/deps/path_anchoring.py). The result differs by scope:../../../apm_modules/<repo>/commands/foo.md--global:../../../.apm/apm_modules/<repo>/commands/foo.mdThe difference is just the single
.apm/segment, but because theSKILL.mdcontent changes, thedeployed_file_hashes/content_hashchange even for the same commit.Observed (same skill, same commit):
content_hash: sha256:e36a77ef…--global:content_hash: sha256:04da55da…As a result, a lockfile generated under one scope, when used for an install under a different scope, always has a content mismatch for skills containing relative links.
How this differs from existing issues
The "
apm installrewrites the lockfile on every run" lineage (#450 / #1532 / #1702 / #2078, all closed) were idempotency false positives — the lock was rewritten in the same scope even though content was unchanged. This case is different: the content genuinely differs by scope, so those fixes do not address it.#2187 (open) is also a
content_hashportability problem, but its cause is OS line-ending differences (CRLF/LF); this case is same-OS, scope-driven — a different axis. In the same spirit as #1959 (which normalized line endings out of the hash), the question is whether deploy-scope-dependent relative links should likewise be excluded from the hash.Minimal reproduction
SKILL.mdand acommands/foo.mdthat theSKILL.mdreferences via a relative path.apm install(project scope) in some project directory; record the skill'scontent_hash.apm.yml/apm.lock.yaml, runapm install --global; observe thatcontent_hashchanges.SKILL.mddiffers betweenapm_modules/…and.apm/apm_modules/….Questions
content_hash(which includes the deploy-scope-dependent rewritten relative links) intended to be install-scope-specific?content_hashbe scope-independent?All reactions