Skip to content

Lockfile specification

Normative reference: This page describes the CLI’s v0.2 working draft. OpenAPM v0.1, Section 5 defines the normative contract; its unratified 0.1.46 and 0.1.60 amendments select lockfile-v0.1.60.schema.json, adding manifest extensions and per-edge subset pairings without changing earlier schema bytes. See schema identity and status.

apm.lock.yaml is the pinned record of every resolved dependency and every file APM deployed into the workspace. It is the source of truth for reproducible installs and for drift detection. Commit it.

The pin covers the full dependency graph as it existed when APM resolved it, including transitive package manifests. A later upstream edit to a transitive package’s apm.yml does not change installs that replay an existing lockfile; APM keeps using the recorded commits until you run apm update, apm lock --update, or delete apm.lock.yaml and re-run apm install after changing apm.yml.

This is a Working Draft. A new or promoted lockfile whose packages record a content_hash uses version "4"; otherwise ordinary projects use "1" (plain Git projects) or "2" (projects with at least one registry-sourced dependency or Git semver-resolved dependency). The bump is opportunistic; see Version bumping. Registry-sourced dependencies require the experimental registries feature (apm experimental enable registries) before install or replay.

The explicit, unratified root source replacement candidate uses version "3" unless a package content_hash selects "4".

The lockfile gives APM four things:

  1. Reproducibility. apm install --frozen reinstalls the exact commits recorded here - no resolution, no network drift. Regular apm install also reuses locked commits for unchanged Git dependencies, including transitive entries, so the graph does not silently follow upstream manifest moves.
  2. Integrity. Recorded SHA-256 hashes let apm audit detect tampering with deployed files.
  3. Cleanup. The list of deployed files lets apm prune remove orphans when a dependency is dropped from apm.yml.
  4. Inspection. apm deps why, apm view --file and apm audit read the lockfile to answer “what is actually installed”.

The lockfile lives at the project root next to apm.yml:

my-project/
|- apm.yml
|- apm.lock.yaml <- here
|- apm_modules/

Always commit it. The lockfile is what makes a fresh clone install identically on any machine.

apm.yml records dependency intent; apm.lock.yaml records the resolved graph and managed-file state. Keep both in version control. apm_modules/ contains installed dependency content, which can be regenerated with apm install while the declared package sources remain available.

Normally, keep apm_modules/ gitignored. Project installs add this entry to .gitignore automatically when it is missing:

apm_modules/

For CI workflows, check out the committed manifest and lockfile, then run apm install --frozen to restore the locked dependency graph. Discard a disposable workspace only after all dependent operations, native agent sessions, and other consumers have finished.

APM has no install flag for automatic post-install removal. For a separate cleanup step, apm deps clean removes the project apm_modules/ without deleting apm.yml or apm.lock.yaml; the same lifetime restriction applies. Reinstall before using consumers that need those resources again. See What to commit for target-owned files.

lockfile_version: "4"
apm_version: "0.37.0"
dependencies:
- repo_url: https://github.com/acme-corp/security-baseline
resolved_commit: a1b2c3d4e5f6789012345678901234567890abcd
resolved_ref: v2.1.0
version: "2.1.0"
depth: 1
package_type: apm_package
deployed_files:
- .github/instructions/security.instructions.md
- .github/agents/security-auditor.agent.md
- repo_url: https://github.com/acme-corp/common-prompts
resolved_commit: f6e5d4c3b2a1098765432109876543210fedcba9
resolved_ref: main
depth: 2
resolved_by: https://github.com/acme-corp/security-baseline
package_type: apm_package
deployed_files:
- .github/instructions/common-guidelines.instructions.md
- repo_url: https://github.com/acme-corp/security-baseline
source: registry
version: "2.1.0"
resolved_url: https://registry.example.com/v1/packages/acme/security-baseline/versions/2.1.0/download
resolved_hash: "sha256:abc123..."
depth: 1
package_type: apm_package
mcp_servers:
- github
- transitive-server
mcp_configs:
github:
type: stdio
command: docker
args: ["run", "-i", "--rm", "ghcr.io/github/github-mcp-server"]
transitive-server:
type: stdio
command: local-server
mcp_target_servers:
codex:
- github
copilot:
- github
- transitive-server
mcp_config_provenance:
transitive-server: local-package
lsp_servers:
- pyright
lsp_configs:
pyright:
name: pyright
command: pyright-langserver
args: ["--stdio"]
extensionToLanguage:
".py": python
lsp_target_servers:
claude:
- pyright
lsp_config_provenance:
pyright: "project:."
local_deployed_files:
- .github/skills/my-local-skill/SKILL.md
local_deployed_file_hashes:
.github/skills/my-local-skill/SKILL.md: "sha256:a1b2c3..."
deployments:
- kind: project-relative
target: copilot
value: .github/instructions/security.instructions.md
runtime: null
scope: project
owners:
- https://github.com/acme-corp/security-baseline
active_owner: https://github.com/acme-corp/security-baseline
content_hash: "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
FieldTypeRequiredNotes
lockfile_versionstringyes"4" once a new or promoted lockfile records any content_hash; otherwise "1" for plain Git projects, "2" for registry/Git semver evidence, and candidate "3" when a root replacement table is present.
(Deprecated) generated_atISO 8601 stringnoLegacy write timestamp. New lockfiles omit it; when an existing lockfile carries it, APM refreshes it on substantive writes. Ignored by equivalence checks.
apm_versionstringnoAPM CLI version that last changed the file; every command that rewrites it records itself. An older APM refuses to install, update, uninstall, prune, lock, compile, audit or pack against it, and read-only commands warn; see Lockfile written by a newer APM. Missing or unknown values are accepted; a duplicate or invalid value is refused. Otherwise it is diagnostic except for a narrow compatibility path: exact APM 0.28 metadata, a locked marketplace_plugin type, and a matching content hash together authorize the receipt-less cached-plugin upgrade. It never overrides canonical apm.yml precedence or applies to freshly fetched dependencies. A lockfile written before 0.37 that records copilot or vscode MCP entries keeps its apm_version until an install moves those entries to .mcp.json.
manifest_targetsstring listnoTargets apm.yml declared when the lockfile was last changed ([] when it declares none and targets are auto-detected). A target this list names and apm.yml no longer declares is a dropped target: apm install --frozen refuses and apm audit --ci fails until apm install retires its files. Files of a target only an explicit --target deployed are not dropped. Older lockfiles without this field treat every undeclared target as dropped.
dependencieslistyesResolved APM packages. See per-entry fields.
mcp_serverslist of stringsnoNames of MCP servers managed as of the last install or update, including transitively contributed servers.
mcp_configsmapnoserver_name -> resolved config dict baseline used to detect MCP drift. A Claude plugin’s ${CLAUDE_PLUGIN_ROOT} is recorded unexpanded; a value an older release recorded expanded at an apm_modules path still matches.
mcp_omissionsmapnoInstall-time dependency MCP exclusions: each server maps to a declaration fingerprint and reason: only-apm, untrusted-transitive, unapproved-executables (a package self-defined server the executables gate has not approved), denied, or definition-changed (the server no longer matches its pinned approval). The fingerprint binds canonical dependency identity, source pin, dependency depth and authored declaration before plugin-root expansion, using the same manifest snapshot as the expanded config. It does not use self-asserted inventory name or version. An admitted baseline supersedes old omission evidence, but remains subject to normal drift checks. Audit never treats this as native ownership or as an exemption for root or previously admitted MCP. The lockfile is evidence, never consent: audit re-derives admission from apm.yml and the cached org policy, so a lock-only edit cannot admit a server. apm install --frozen re-applies admission and accepts only evidence equal to what install would record now. Missing or stale evidence cannot establish deliberate omission; see config-consistency for reconciliation.
mcp_target_serversmap of string listsnotarget -> server names for MCP entries APM successfully wrote. copilot and claude each record a server they share in the project .mcp.json. An older lockfile’s project vscode entries and unsettled copilot entries, and a copilot entry whose fingerprint matches an entry in .github/mcp.json or .vscode/mcp.json, name APM’s entries in those retired files: apm install removes them by proof, and no command treats them as .mcp.json ownership. When neither retired file holds such an entry any more (for example after apm install --frozen moved it; for a copilot entry .github/mcp.json must still exist), the next install takes ownership of the declared server’s .mcp.json entry only if it equals what APM writes for it. If the self-defined server is no longer declared, its entry is removed only if it is identical to APM’s render of the locked declaration; registry entries stay. An empty map authorizes no cleanup; it is omitted once no MCP server is left. Older lockfiles lacking this field can recover ownership only for self-defined native entries matching their stored mcp_configs baseline; registry-resolved and user-edited entries remain unowned. A missing lockfile grants no ownership of existing native entries.
mcp_config_provenancemapnoserver_name -> declaring package for transitively contributed MCP servers. Used to identify the former owner in config-consistency diagnostics; it never exempts a lock-only entry.
lsp_serverslist of stringsnoNames of all LSP servers in current APM-managed state, including package- and bundle-contributed servers.
lsp_configsmapnoserver_name -> resolved config dict retained for owner-aware lifecycle reconciliation. It is not an apm audit drift baseline.
lsp_target_serversmap of string listsnotarget -> server names for LSP entries APM successfully wrote. Reinstall and uninstall use this ownership record to remove stale executable entries without claiming legacy or user-owned content.
lsp_config_provenancemap of stringsnoserver_name -> declaration owner using project:., package:<identity>, or bundle:<identity>. Reconciliation uses this field to preserve bundle and surviving-package entries while removing departed owners.
local_deployed_fileslistnoFiles this project itself contributes (sources its own primitives). Reinstall reconciles these paths with the same target rules as per-dependency deployed_files. See self entry.
local_deployed_file_hashesmapnopath -> sha256:<hex> for local_deployed_files.
local_staged_fileslistnoLocal bundle instructions staged under apm_modules/<bundle>/.apm/ as apm compile input for targets without native instructions (Codex, Gemini, OpenCode). Not deployment claims: deployed-files-present does not check them. apm prune removes the staging and these rows.
local_staged_file_hashesmapnopath -> sha256:<hex> for local_staged_files. apm audit --ci (content-integrity) fails and apm compile warns when staged content no longer matches. Paths without a hash (older lockfiles) make no drift claim until the next bundle install records one; a locally edited file that install skips is recorded with the bundle’s hash, so the edit shows as drift.
deploymentslistnoCanonical deployment ownership rows, additive alongside the legacy deployed_files/local_deployed_files views. See Canonical deployment rows.

Each item in deployments is one locator — one deployed file or native runtime entry — with its full ownership history:

FieldTypeNotes
kindstringLocator storage form: project-relative, target-relative, or uri (e.g. an MCP server entry).
targetstringDeploy target name (copilot, claude, mcp, etc.), or legacy when the row was recorded without one. See unattributed rows.
valuestringThe path (relative to its kind) or URI value.
runtimestring or nullRuntime scoping the row, when applicable (e.g. an MCP client name).
scopestringInstall scope: project, or user for rows in the user lockfile ($APM_HOME/apm.lock.yaml), such as apm install -g bundle files.
ownerslist of stringsEvery dependency key that has ever claimed this locator, oldest to newest.
active_ownerstringThe current claimant. Always one of owners; a row where it is not is malformed.
content_hashstring or nullsha256:<hex> digest of the deployed content, when known.

Fresh MCP writes on Claude, Codex and every JSON-config target store a SHA-256 fingerprint of the normalized native entry actually written in the MCP URI row’s existing content_hash. The fingerprint also proves APM’s own entry when a value resolved at install time (a credential source or a Gemini env value) has changed since: outside Claude and Codex, that entry is kept as written until its declaration changes, and is never reported as a conflict. Cleanup verifies against this retained receipt without a registry lookup. Older registry rows with null hashes remain unverified and protected. This records no duplicate secret values and requires no new lockfile field or version. Full APM dependency lockfile rebuilds retain these receipts, including apm install --only apm.

Partial self-defined conflicts in ordinary installs or bundle application preserve prior retirement/deferred-cleanup entries and claims and unrelated owners, without restoring ownership revoked by the current attempt. Registry writes preceding a self-defined install conflict retain their receipts and ownership even when install exits 1. Bundle MCP declarations support only self-defined connections, not registry references. A registry conflict does not skip later registry groups or self-defined updates: successful writes and their stored baselines remain aligned before the command reports failure.

owners and active_owner must each resolve to a member of the valid owner universe for that lockfile: every current key in dependencies, the workspace self-owner ., or local-bundle (imperative content added outside the replayable install pipeline, e.g. apm unpack). A reference to a dependency key no longer present in dependencies is a stale owner — apm audit reports it as deployment-ledger-owners and apm prune repairs it; see Baseline checks and apm prune.

deployments is the canonical source APM writes to going forward. The per-dependency deployed_files/deployed_file_hashes and the top-level local_deployed_files/local_deployed_file_hashes/mcp_target_servers/ lsp_target_servers fields remain on disk as derived, one-cycle-compatible legacy views of the same ledger — older tooling that only reads the flat fields still sees a consistent projection. Author neither view by hand; both are written by apm install, apm prune, and related commands.

legacy marks rows recorded without a concrete target. Install preserves ambiguous historical rows, including untagged historical bundle output; neither a path nor a saved hash establishes cleanup authority. Cleanup requires explicit governance backed by provenance. Current project-local installs record concrete target ownership for later rename, deletion, and target-removal reconciliation. This does not broaden legacy dependency cleanup or change canonical safe-deletion checks.

Each item in dependencies describes one resolved package.

Marketplace semver selections reuse the Git-semver fields: constraint, resolved_tag, and version record the requested selector, selected tag, and selected version. Here version comes from the publisher’s tag pattern, not the package’s display version. resolved_at records the resolution’s UTC timestamp and is advisory, never an audit or replay tie-breaker. Reinstalling the same marketplace selection preserves this timestamp; changed selection or catalog provenance records a new resolution time. resolved_ref agrees with resolved_tag, and resolved_commit pins the installed bytes. Audit requires this locked evidence for version selections; it neither guesses a tag pattern nor re-resolves the catalog. discovered_via + marketplace_plugin_name associate a declaration with one locked coordinate, not a durable catalog trust identity. Install replays that coordinate without contacting the catalog while the declaration’s name, marketplace and version still match it; apm update resolves the catalog again. A registry-routed catalog entry is locked as a source: registry row with no resolved_commit: its exact version, resolved_url and resolved_hash are the locked evidence, and any declared version must still accept the locked version.

source_url is that identity: the catalog’s canonical origin, recorded for every remote catalog kind (hosted marketplace.json, GitHub, GitLab, Azure DevOps, generic Git). The alias in discovered_via is machine-local, so when APM re-resolves a locked object-form entry it fails closed if the alias’s registered origin no longer matches source_url, naming both origins. Comparison ignores transport (HTTPS or SSH), userinfo, default ports, a trailing .git, host case and alias case; a hosted URL’s query is kept. The catalog path is not compared, because the lock does not record it. Local filesystem catalogs record no source_url or source_digest, because their paths are machine-specific. Rows written before 0.37 have no source_url; they keep working and gain it on the next lockfile write. No new fields are added for this.

FieldTypeRequiredNotes
repo_urlstringyesCanonical repository path or URL. Entry identity is derived from repo_url, host, and virtual/local markers; see lockfile identity keys.
materialization_repo_urlstringnoSource-cased path that preserves repository display spelling when APM reconstructs the dependency, including for apm_modules/ materialization and generated links. Omitted when it equals repo_url; it must normalize to the same identity and cannot redirect a lock entry.
aliasstringnoValidated directory name directly below apm_modules/, preserved for replay, audit, and removal. Placement metadata only; it does not change repository identity, source coordinates, or the resolved revision. Missing means no alias override, never an alias inferred from name.
hoststringnoFQDN when not inferable from repo_url (e.g. for registry proxies or non-GitHub hosts).
host_typestringnoExplicit host-kind hint, currently gitlab, copied from object-form type: gitlab.
portintnoNon-standard SSH/HTTPS port. Validated to 1..65535 on read.
registry_prefixstringnoURL path prefix when resolved through a registry proxy (e.g. artifactory/github).
resolved_refstringnoThe user-supplied ref from apm.yml (main, v1.2.0, a SHA).
resolved_commitstringnoExact 40-char commit SHA installed. The pin.
namestringnoPackage name as declared in the dependency’s own apm.yml at resolution time. For package_type: claude_skill, the name comes from SKILL.md frontmatter with the directory name as fallback. SELF-ASSERTED author-claim metadata — NOT integrity-verified and MUST NOT be used for trust decisions or identity keying. Cross-reference repo_url + resolved_commit (or resolved_hash) for ordinary provenance. Replacement entries instead use replacement.source with the selected commit or content hash; repo_url retains original ownership. Omitted when absent.
versionstringnoResolved package version. For registry entries: the exact version selected from the registry for reinstall; resolved_hash remains the integrity anchor. For Git-semver selections, including marketplace object-form version, this is the selected semver recorded with constraint and resolved_tag. Otherwise Git/local entries carry the dependency’s apm.yml version as display/inventory metadata, or unknown for package_type: claude_skill without apm.yml. Replay uses resolved_ref/resolved_commit, not inventory versions. Inventory metadata is SELF-ASSERTED; see name above.
virtual_pathstringnoSubpath inside the repo for virtual packages (monorepo subpaths).
is_virtualboolnotrue when the entry is a virtual subpath package.
depthintnoPosition in the dependency tree. 0 is the project itself, 1 is a direct dep, higher is transitive. Defaults to 1.
resolved_bystringnorepo_url of the parent that pulled this transitive dep. Absent for direct deps. Rewritten by apm uninstall when a rescued transitive dependency’s original parent is removed, so the entry stays keyed on a genuine surviving parent — this never changes the entry’s identity or lock key, only which parent it points to.
package_typestringnoKind of package: apm_package, skill_bundle, claude_skill, hook_package, hybrid, agent_plugin, marketplace_plugin. Drives target placement.
skill_subsetlist of stringsnoFor dependencies that expose selectable skills: the sorted union of the skill names every declaring edge selected (the project’s apm.yml and any parent package). Empty means “all”; one declaration without skills: makes it “all”.
target_subsetlist of stringsnoSorted union of the canonical target names every declaring edge selected with targets: (vscode is recorded as copilot; older lockfiles that recorded vscode read as copilot). Empty means “all active install targets”; one declaration without targets: makes it “all”.
subset_pairingslist of mappingsnoPresent only when declarations pair different skills with different targets, so skill_subset x target_subset would over-deploy. Each mapping has optional sorted skills and targets lists (omitted = all); a skill deploys to a target only when one mapping pairs them. Older lockfiles without it replay as the plain product. See OpenAPM req-rs-018.
deployed_fileslist of stringsnoSorted project-relative paths APM wrote for this dependency; powers prune and audit’s file-presence check. Shared paths have one canonical owner; uninstall transfers ownership to a surviving provider. Reinstall preserves other declared, gated, or dynamic targets’ entries. On explicit manifest contraction, install/prune removes dropped targets’ files only if recorded hashes match; edited files remain tracked on disk. apm lock preserves files and their deployed_files, deployed_file_hashes, and deployment-ledger rows until normal install can verify and perform cleanup. Without targets: or target: in the consumer’s apm.yml, reinstall preserves inactive targets’ deployed files, merge-hook configuration, and ownership sidecars, even with --target. A --target override does not declare dropped targets; only explicit manifest contraction permits pruning them.
deployed_file_hashesmapnopath -> sha256:<hex> for the files in deployed_files. Powers audit’s content-integrity check. Hashed over canonical content — UTF-8 text is normalized CRLF -> LF (bare CR preserved) so the hash is the same whether git checks the file out with Windows or POSIX line endings; binary is hashed raw. Directory entries (trailing /) have no hash.
native_pluginmapnoOwnership record for a plugin APM deployed intact: name, root (.agents/plugins/<name>), fingerprint (sha256:<hex> over each publisher file’s path and bytes, plus its exec bit at user scope, excluding APM’s root apm.yml and .apm/) and marketplace (name, path). APM’s only evidence for the settings entries and roots it may remove. See Native plugins.
native_declaredlistnoHarnesses (claude, copilot) whose settings held APM’s true for that native plugin when the lock was written. Lets APM tell its own Copilot value from a hand edit; written only with native_plugin.
exec_statusstringnoExecutable-trust state of this dep’s executable primitives, set by the install-time gate via the shared deny-wins resolver. One of deployed (trusted and materialized), gated_pending_approval (present but parked until approved), denied (blocked by an org/user deny), or absent (declares no executables). Consumed by audit’s required-executable-untrusted signal; see Executable approval.
exec_allowed_typesarray of stringsnoExecutable types a gated_pending_approval or denied package still deployed because they are approved (for example [hooks]). Present only for a partial approval, so apm update notices when one type’s approval is added or removed.
sourcestringno"local" for path dependencies, "registry" for dedicated-registry resolutions. Absent for Git deps.
resolved_urlstringregistry onlyFully-qualified download URL recorded at resolution. Advisory on replay: APM fetches it only through a registry declared in apm.yml that serves it; otherwise it fetches the locked version from the configured registry. Either way the bytes must match resolved_hash.
resolved_hashstringregistry onlySHA-256 digest of the registry archive bytes, verified on every install.
local_pathstringnoOriginal path from apm.yml for local deps, relative to project root.
content_hashstringnoSHA-256 of the materialized package tree, excluding carried_licenses copies. In version "4" each file in sorted relative-path order contributes its path, a NUL byte and the SHA-256 of its raw bytes; versions "1" to "3" keep the earlier path-and-bytes stream. Dependency checkouts pin core.autocrlf=false and core.eol=lf, so LF-committed text / text=auto content is not rewritten as CRLF on any platform. Explicit .gitattributes eol= requests, binary files and bytes committed as CRLF keep their repository-defined bytes. For remote dependencies it verifies that downloaded or cached content still matches the lock; for local path dependencies it detects source-tree changes.
is_devboolnotrue when the dep was declared under devDependencies.
discovered_viastringnoMarketplace name that surfaced this package (provenance).
marketplace_plugin_namestringnoPlugin name as listed in that marketplace.
source_urlstringnoCanonical origin of the catalog the package was selected from: the hosted marketplace.json URL as registered, or the Git catalog repository URL without userinfo, default port or .git. Omitted for local filesystem catalogs.
source_digeststringnosha256:<hex> digest of the catalog used for resolution: the raw bytes for a hosted marketplace.json, or the canonical JSON (sorted keys, no whitespace) for a Git-hosted catalog. Provenance only, never a package trust anchor.
is_insecureboolnotrue when the source URL was http://.
allow_insecureboolnotrue when the manifest explicitly opted in to the insecure source.
constraintstringgit-source semver onlyThe original semver selector from Git ref: or marketplace object-form version in apm.yml (^1.2.0, ~1.4, 1.2.3). Together with resolved_tag and selected version, distinguishes a resolved selection from package inventory metadata. Replay pins the selected tag and commit rather than re-resolving the selector.
resolved_tagstringgit-source semver or SHA-pin updatesThe concrete annotated git tag (v1.5.3, widget--v1.5.3) that satisfied constraint or justified the latest full-SHA revision-pin update.
resolved_atstringgit-source semver onlyRFC 3339 timestamp of the resolution: how old the pin is.
declared_licensestringnoThe license the package manifest declares (license: in apm.yml, or license in a plugin.json), recorded verbatim at resolve time and syntax-validated offline against the bundled SPDX id set. An author claim, not a conclusion from LICENSE text — APM never interprets a license file. Omitted when undeclared (absence means unknown; no sentinel is stored). Surfaced by apm lock export.
carried_licenseslistnoLicence files APM copied, byte-for-byte, into the materialized package: the nearest LICENSE, LICENSE.*, COPYING or NOTICE from the package path up to the repository root, plus a copy next to each skill directory that has none. Each item has path (copy, relative to the package root), source (original file, relative to the repository root at resolved_commit) and hash (sha256:<hex>, line-ending normalized like deployed-file hashes). The copies are excluded from content_hash and verified against hash instead, so lockfiles written before this field keep verifying. Omitted when nothing was carried.
extensionsmapnoVendor keys matching x-[a-z][a-z0-9-]* from the dependency’s own apm.yml, in declaration order. Values are recorded as declared and are not interpreted. Omitted when the dependency declares none. See req-ext-003.

Fields are emitted only when set. A minimal entry is just repo_url plus resolved_commit.

Azure DevOps uses the same generic host and repo_url fields as every other Git provider. APM derives its transient organization, project, and repository coordinates when reconstructing the dependency reference; no ADO-specific fields are persisted.

Lockfile dependency keys keep github.com implicit for migration stability: existing github.com entries remain keyed as owner/repo. Local dependencies use local_path directly. Virtual dependencies append virtual_path to the base repo key. Entries for non-default hosts prefix the key with the lowercased host (host/owner/repo), so github.com/team/skills and gitea.myorg.com/team/skills can coexist without overwriting each other, and host casing cannot create duplicate keys. A non-default port names another server, so it qualifies the host segment (host:port/owner/repo), on github.com too; port-less keys are unchanged. Registry-proxy entries keep the bare logical key because the proxy host is transport, not package identity.

GitHub and package-registry owner/repository paths are lowercased before APM derives the key. Older mixed-case GitHub entries therefore serialize with the same key as new lowercase references. Their source spelling is retained separately in materialization_repo_url, so filesystem paths and relative links do not reuse the lowercase comparison key. Repository path casing remains identity-significant for unknown git hosts because those backends may be case-sensitive.

A project that ships its own primitives (skills, agents, prompts under .github/, .claude/, etc.) records the files it deploys to its own targets under local_deployed_files and local_deployed_file_hashes at the top level.

Internally, when the lockfile is loaded, APM synthesizes a virtual dependency entry keyed by "." so that orphan detection, audit, and prune can iterate all “owned” files uniformly. This synthesized entry has:

  • repo_url: <self>
  • source: local
  • local_path: "."
  • depth: 0
  • is_dev: true
  • deployed_files and deployed_file_hashes copied from the top-level local_deployed_* fields.

The synthesized entry is not written back to YAML - the flat local_deployed_* fields remain the on-disk source of truth. Treat the self entry as an implementation detail; do not author it by hand.

Root source replacement evidence (candidate)

Section titled “Root source replacement evidence (candidate)”

Version "3" is an unratified implementation candidate. Its proposed schema is staged for review, not an adopted OpenAPM version. It requires a feature-capable development build and the explicit replacement manifest selector. No first supported release has been assigned. Verified older readers v0.25.0, v0.32.0 and v0.33.0 reject this version; v0.24.1 may accept and rewrite it without honoring replacement semantics.

The generated replacements list stores the complete normalized root table, including unused rules. A used dependency has a replacement record: source stores the selected path, or git/optional path/required ref; requests stores original incoming parent, ref, skills, targets, dev and alias evidence. Shared parents and direct-plus-transitive requests remain inspectable. Each selected source must agree with the root table.

Top-level dependency coordinates and materialization ownership remain the original identity, even for a selected local source. Resolved commits/tags and content hashes describe the selected bytes. A local replacement has no invented Git pin. Parent references in this format use exact original lock keys rather than legacy repository-only strings.

Frozen install compares the full table and verifies selected local content through the existing local-content preflight. It refuses missing baseline hashes and changed, added or removed source files before deployment. Audit replays selected sources, including native plugin cache bytes, without mutating the project. Uninstall repairs surviving request evidence and retains dormant rules; it refuses unverifiable replacement reachability before removal. Do not edit this evidence by hand.

Version selection follows the persisted content:

VersionTriggered byAdds
"1"Default for Git-only projects.Baseline schema.
"2"Any dependency with source: "registry" or Git semver resolution fields.resolved_url, resolved_hash, and registry version; constraint, resolved_tag, and resolved_at for Git semver pins.
"3" (candidate)Root replacements table, including an empty table.Complete root rules, per-entry selected source and original incoming requests.
"4"Any package content_hash in a new or promoted lockfile.No new fields; content_hash uses the framed stream (hash framing hardening). Admits every earlier field.

The bump is content-driven. A package content_hash selects "4"; otherwise replacement rules select "3", registry dependencies or Git semver evidence select "2", and the writer uses "1". Removing the replace block and running a normal install restores that ordinary selection. Keeping replace: [] retains the candidate opt-in.

For the registry workflow this enables, see the Registries guide.

When a project is packed with apm pack, the bundled lockfile is enriched with a top-level pack: block:

pack:
format: apm # or "claude-plugin", "agent-plugin"
target: copilot # or comma-joined list, or "all"
packed_at: "2026-05-10T20:14:00+00:00"
mapped_from: # only when cross-target path remapping happened
- .claude/skills/
bundle_files: # only for plugin bundles
skills/my-skill/SKILL.md: "a1b2..."
renderings: # only for plugin bundles: deploying target's extension per packed file
agents/reviewer.md: ".md"

The pack block is read by apm unpack to verify bundle integrity and to restore correct target paths. It is stripped from project lockfiles and only appears inside packed bundles.

local_deployed_files and local_deployed_file_hashes are stripped from bundle lockfiles - they describe the packager’s own repo, which is not shipped.

CommandReadsWrites
apm installexisting lockfile (for --frozen and incremental reuse)full rewrite on resolution change
apm install --frozenrequired, unless apm.yml declares no APM, MCP or LSP dependencyrejects missing pins, incompatible immutable requirements, or MCP config/server-name drift
apm compileyes (resolution + integrity)only when a targets: contraction removes deployed files
apm audityesno
apm pruneyes (orphans and deployments ownership, even with nothing else to prune)yes (after removing orphans and reconciling deployments)
apm deps why, apm view --fileyesno
apm unpackbundle’s pack-enriched lockfilemerges into project lockfile

Only apm install (including --mcp and local bundles), apm lock, apm update (and apm deps update), apm uninstall, apm prune and apm compile write the lockfile. Each writes it at most once, when the command finishes; it is written earlier only before lifecycle scripts or native Claude plugin registration need to observe it.

apm install only rewrites the file when its semantic content changes (generated_at and apm_version are ignored when comparing). A no-op install leaves the file untouched. New lockfiles omit generated_at so independent dependency changes do not manufacture timestamp conflicts. If a pre-existing lockfile includes the field, APM retains it for compatibility and refreshes it only on a substantive write. To migrate a legacy lockfile manually, delete the generated_at: ... line from apm.lock.yaml once; APM will not add it back.

Frozen replay checks immutable requirements from dependency manifests as they are loaded. A lock entry cannot silently replace a required tag or SHA with a different commit. Equivalent tag/SHA spellings are accepted after verification. Unchanged locked literal refs reuse the recorded commit without ref discovery, even if the upstream tag moved or disappeared. Short SHA pins are checked against the full recorded commit’s prefix; matching ref text alone is not enough. New tag names may require a lookup. On a cold cache, APM may fetch a locked parent before discovering its conflicting requirement. Fix the manifest refs and regenerate the lockfile with a normal install.

The lockfile is what apm audit compares the workspace against. Each baseline check maps to specific lockfile fields:

CheckBacked by
deployment-ledger-ownersdeployments rows’ owners and active_owner vs. the valid owner universe
lockfile-existsfile presence at project root
ref-consistencyresolved_ref per entry vs. apm.yml
deployed-files-presentdeployed_files per entry (and self entry)
content-integritydeployed_file_hashes (and local_deployed_file_hashes, local_staged_file_hashes)
skill-subset-consistencyskill_subset, target_subset and subset_pairings per entry, matched against the merge declared by apm.yml and the installed packages’ manifests, and against the resolved package tree
config-consistencymcp_configs, mcp_config_provenance and exact mcp_omissions evidence
no-orphaned-packagesdependencies keys vs. apm.yml
lockfile-targets-currentdeployed_files per entry vs. apm.yml targets:

Files listed in deployed_files without a corresponding hash entry (typically directory markers ending in /) are skipped by content-integrity. Missing files are reported by deployed-files-present, not by content-integrity, so the two checks do not double-count.

Orphan detection works in two directions:

  • Orphan packages - recognized roots under apm_modules/ no longer needed by the dependency graph, even when their lock entries are gone. apm prune removes them while preserving bundles and roots containing needed children.
  • Orphan files - files under managed target directories that no lockfile entry claims. A ghost record alone does not authorize deleting these bytes. Prune repairs ownership metadata; deletion still requires a pruned dependency’s trusted pre-transition claim and preserves surviving owners.

apm prune is the only command that reconciles deployments rows. The valid owner universe and metadata-only repair boundary are defined in Canonical deployment rows; cleanup behavior is documented under apm prune.

lockfile_version is the schema version of the file format itself.

  • The Version bumping table defines when each version is written. Version "3" is an unratified candidate; see Root source replacement evidence.
  • Version "4" keeps every earlier field and changes only how content_hash is computed (hash framing hardening). APM 0.37 verifies a version "1" to "3" lockfile as written. A writable apm install records "4" once every package re-hashes from verified bytes; otherwise the version stays and --verbose names the package to reinstall. apm install --frozen, apm audit and read-only commands never promote or rewrite it. APM 0.36 and earlier refuse version "4", so update CI to APM 0.37 before committing a lockfile it wrote.
  • APM additively extends entries within each version - new optional fields may appear without bumping the version. Older APM clients ignore unknown fields.
  • Breaking changes (renames, removals, semantic shifts) require bumping lockfile_version. APM refuses to operate on a lockfile whose version it does not recognize, and will instruct the user to upgrade or regenerate.

Invalid YAML, an unsupported explicit version, an empty or non-mapping root, malformed container fields, and invalid deployment rows fail closed before APM constructs lock state. Pre-versioned legacy files migrate as v1 inputs. Fix or remove other invalid files explicitly; APM does not silently replace them with an empty lockfile.

A lockfile left with unresolved git merge conflict markers (<<<<<<<, >>>>>>>, or ||||||| at the start of a line) is reported as a merge conflict rather than a YAML scanner error. Commands that require the lockfile name the file and the cause, and direct you to resolve the conflict or restore a known-good lockfile before retrying your original command. APM does not discard, rewrite, or re-resolve the conflicted file. Preview and best-effort readers retain their existing exit behavior. A bare ======= separator is not treated as a conflict marker. See manual repair guidance.

A small project with one remote APM package, one MCP server, and its own local skill:

lockfile_version: "1"
apm_version: "0.6.4"
dependencies:
- repo_url: github.com/octocat/example-skills
resolved_ref: v1.2.0
resolved_commit: 7f3c9a4d2e1b8c7f0a9e6d5c4b3a2918f7e6d5c4
version: 1.2.0
package_type: skill_bundle
depth: 1
skill_subset:
- code-review
- test-writing
deployed_files:
- .github/skills/code-review/SKILL.md
- .github/skills/test-writing/SKILL.md
deployed_file_hashes:
.github/skills/code-review/SKILL.md: "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
.github/skills/test-writing/SKILL.md: "sha256:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
mcp_servers:
- github
mcp_configs:
github:
type: stdio
command: docker
args: ["run", "-i", "--rm", "ghcr.io/github/github-mcp-server"]
local_deployed_files:
- .github/skills/my-local-skill/SKILL.md
local_deployed_file_hashes:
.github/skills/my-local-skill/SKILL.md: "sha256:fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9"

Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.