You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uninstall: consent path for offline or deleted sources #4295
Since 0.37, apm uninstall removes a tracked file only when it has deployment evidence: a local deployment receipt, or a render of the locked package version that matches the file. When the source is unreachable (offline, private or deleted) and no receipt exists yet (for example right after upgrading), uninstall refuses with exit 1 and changes nothing. The 0.37 remedies are to run apm install once with the source reachable, or to remove the files manually.
Desired behaviour
An explicit, user-consented path for uninstalling when the source cannot be reached:
delete only files whose bytes equal the locked hash, printing each deleted path;
keep any file whose bytes differ, and name it;
the lockfile alone never authorizes deletion; the explicit consent replaces the missing evidence.
Notes
Owner: the uninstall cleanup / deployment-evidence owner.
Decision: approve
Area: project
Scope: An explicit consent path for uninstalling when deployment evidence is missing (for example the source is offline, private or deleted and no receipt exists yet). With --trust-lockfile, for each file _refuse_uninstall_without_evidence in src/apm_cli/commands/uninstall/cli.py would refuse, uninstall deletes the file only when its bytes equal the hash apm.lock.yaml records for it and prints each deleted path; a file whose bytes differ, or is unreadable or symlinked, is kept and named with the existing kept-file warning, and the command exits 0. The verdict stays with DeploymentEvidence in src/apm_cli/integration/cleanup.py (owner file-level-deploy-sync-cleanup), which gains the consented hash-equality verdict; no second deletion rule. Without the flag, behaviour is exactly 0.37: refuse with exit 1 and change nothing. The uninstall evidence remedies (UNINSTALL_EVIDENCE_REMOVE, UNINSTALL_EVIDENCE_REINSTALL in src/apm_cli/core/remediation.py) name the flag as the third remedy.
Done when: an installed-CLI lifecycle test (new module tests/integration/test_uninstall_trust_lockfile_lifecycle.py) that fails on main d365b87: after install, the deployment receipts are removed and the package source made unreachable; apm uninstall <pkg> still refuses and changes nothing; apm uninstall <pkg> --trust-lockfile deletes and prints every file equal to its locked hash, keeps and names one edited file, removes the package from apm.yml and apm.lock.yaml, and apm audit --ci then passes or reports only the kept file as unmanaged; the same with -g. Controls stay green unchanged: the Uninstall refused cells in tests/lifecycle/security/test_integrity.py and tests/integration/test_uninstall_refusal_lockfile_truth_lifecycle.py. Docs: reference/cli/uninstall.md (Options and the deployment-evidence paragraph in Behavior) and the uninstall row of packages/apm-guide/.apm/skills/apm-usage/commands.md. One Added line in CHANGELOG.md under [Unreleased] ending with the PR number.
Out of scope: changing the default refusal; letting a lockfile hash authorize deletion without the flag; apm prune and install cleanup; an interactive prompt; deleting files the lockfile does not record.
Review contact: Daniel Meppiel (@danielmeppiel)
Decision: approve
Area: project
Scope: An explicit consent path for uninstalling when deployment evidence is missing because no locked render can be produced (source offline, private or deleted, checkout gone) and no receipt exists. With --trust-lockfile, uninstall deletes a file that _refuse_uninstall_without_evidence in src/apm_cli/commands/uninstall/cli.py would refuse only when: receipt state was read without error and holds no receipt for it; no render of its owning locked package could be produced; and its content hash (req-lk-012 domain) equals the hash apm.lock.yaml records for that path under that owner. Every other refused file is kept and named: a receipt or render that differs, a successful render lacking the path, no or conflicting recorded hash, unreadable, or symlinked. One uninstall-scoped decision in DeploymentEvidence (src/apm_cli/integration/cleanup.py, owner file-level-deploy-sync-cleanup) drives both the refusal check and the deletion, rechecking content before removal; install and prune are unchanged. Each deleted path is printed. Kept files do not fail the command; existing failure exits still apply. Without the flag, exit code and filesystem effects are exactly 0.37's; the refusal marks each file as deletable or kept under the flag and offers the flag (src/apm_cli/core/remediation.py) only when at least one file is deletable. req-lk-024 is amended through normal spec review to permit only this per-invocation consent exception, and the code cites it.
Done when: an installed-CLI lifecycle test (new module tests/integration/test_uninstall_trust_lockfile_lifecycle.py) that fails on main f8c31a5: after install, receipts are removed, the checkout and cache removed and the source made unreachable; apm uninstall <pkg> refuses, changes nothing and previews each file; with --trust-lockfile it deletes and prints every eligible file, keeps and names one edited file, removes the package from apm.yml and apm.lock.yaml, and apm audit --ci passes or reports only the kept file as unmanaged; the same with -g. Negative controls: with the source reachable, a lockfile row claiming a user-authored file with its matching hash keeps it under the flag; a file with a mismatched receipt and no matching render is kept; unreadable receipt state deletes nothing. Existing Uninstall refused cells in tests/lifecycle/security/test_integrity.py and tests/integration/test_uninstall_refusal_lockfile_truth_lifecycle.py stay green unchanged. Spec: req-lk-024 amendment with conformance updates. Docs: reference/cli/uninstall.md and the uninstall row of packages/apm-guide/.apm/skills/apm-usage/commands.md. One Added line in CHANGELOG.md under [Unreleased] ending with the PR number.
Out of scope: changing the default refusal; a lockfile hash authorizing deletion without the flag or over contrary evidence; apm prune and install cleanup; an interactive prompt; a --dry-run preview; a config or environment equivalent of the flag; deleting files the lockfile does not record.
Review contact: Daniel Meppiel (@danielmeppiel)
The record above supersedes the earlier apm-scope:v1 record on this issue from today (2026-11-21). It was amended after a precedent review: --trust-lockfile only fills missing evidence, never overrides evidence that a file differs, previews in the refusal, and lands with a req-lk-024 spec amendment.
Activity
danielmeppiel commentedon Nov 20, 2026
0.38 by Daniel's 2026-11-20 scope call: enhancement/design; 0.37 fails closed with a required proof cell.
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: An explicit consent path for uninstalling when deployment evidence is missing (for example the source is offline, private or deleted and no receipt exists yet). With
--trust-lockfile, for each file_refuse_uninstall_without_evidencein src/apm_cli/commands/uninstall/cli.py would refuse, uninstall deletes the file only when its bytes equal the hash apm.lock.yaml records for it and prints each deleted path; a file whose bytes differ, or is unreadable or symlinked, is kept and named with the existing kept-file warning, and the command exits 0. The verdict stays withDeploymentEvidencein src/apm_cli/integration/cleanup.py (owner file-level-deploy-sync-cleanup), which gains the consented hash-equality verdict; no second deletion rule. Without the flag, behaviour is exactly 0.37: refuse with exit 1 and change nothing. The uninstall evidence remedies (UNINSTALL_EVIDENCE_REMOVE,UNINSTALL_EVIDENCE_REINSTALLin src/apm_cli/core/remediation.py) name the flag as the third remedy.Done when: an installed-CLI lifecycle test (new module tests/integration/test_uninstall_trust_lockfile_lifecycle.py) that fails on main d365b87: after install, the deployment receipts are removed and the package source made unreachable;
apm uninstall <pkg>still refuses and changes nothing;apm uninstall <pkg> --trust-lockfiledeletes and prints every file equal to its locked hash, keeps and names one edited file, removes the package from apm.yml and apm.lock.yaml, andapm audit --cithen passes or reports only the kept file as unmanaged; the same with-g. Controls stay green unchanged: theUninstall refusedcells in tests/lifecycle/security/test_integrity.py and tests/integration/test_uninstall_refusal_lockfile_truth_lifecycle.py. Docs: reference/cli/uninstall.md (Options and the deployment-evidence paragraph in Behavior) and the uninstall row of packages/apm-guide/.apm/skills/apm-usage/commands.md. One Added line in CHANGELOG.md under [Unreleased] ending with the PR number.Out of scope: changing the default refusal; letting a lockfile hash authorize deletion without the flag;
apm pruneand install cleanup; an interactive prompt; deleting files the lockfile does not record.Review contact: Daniel Meppiel (@danielmeppiel)
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: An explicit consent path for uninstalling when deployment evidence is missing because no locked render can be produced (source offline, private or deleted, checkout gone) and no receipt exists. With
--trust-lockfile, uninstall deletes a file that_refuse_uninstall_without_evidencein src/apm_cli/commands/uninstall/cli.py would refuse only when: receipt state was read without error and holds no receipt for it; no render of its owning locked package could be produced; and its content hash (req-lk-012 domain) equals the hash apm.lock.yaml records for that path under that owner. Every other refused file is kept and named: a receipt or render that differs, a successful render lacking the path, no or conflicting recorded hash, unreadable, or symlinked. One uninstall-scoped decision inDeploymentEvidence(src/apm_cli/integration/cleanup.py, owner file-level-deploy-sync-cleanup) drives both the refusal check and the deletion, rechecking content before removal; install and prune are unchanged. Each deleted path is printed. Kept files do not fail the command; existing failure exits still apply. Without the flag, exit code and filesystem effects are exactly 0.37's; the refusal marks each file as deletable or kept under the flag and offers the flag (src/apm_cli/core/remediation.py) only when at least one file is deletable. req-lk-024 is amended through normal spec review to permit only this per-invocation consent exception, and the code cites it.Done when: an installed-CLI lifecycle test (new module tests/integration/test_uninstall_trust_lockfile_lifecycle.py) that fails on main f8c31a5: after install, receipts are removed, the checkout and cache removed and the source made unreachable;
apm uninstall <pkg>refuses, changes nothing and previews each file; with--trust-lockfileit deletes and prints every eligible file, keeps and names one edited file, removes the package from apm.yml and apm.lock.yaml, andapm audit --cipasses or reports only the kept file as unmanaged; the same with-g. Negative controls: with the source reachable, a lockfile row claiming a user-authored file with its matching hash keeps it under the flag; a file with a mismatched receipt and no matching render is kept; unreadable receipt state deletes nothing. ExistingUninstall refusedcells in tests/lifecycle/security/test_integrity.py and tests/integration/test_uninstall_refusal_lockfile_truth_lifecycle.py stay green unchanged. Spec: req-lk-024 amendment with conformance updates. Docs: reference/cli/uninstall.md and the uninstall row of packages/apm-guide/.apm/skills/apm-usage/commands.md. One Added line in CHANGELOG.md under [Unreleased] ending with the PR number.Out of scope: changing the default refusal; a lockfile hash authorizing deletion without the flag or over contrary evidence;
apm pruneand install cleanup; an interactive prompt; a--dry-runpreview; a config or environment equivalent of the flag; deleting files the lockfile does not record.Review contact: Daniel Meppiel (@danielmeppiel)
danielmeppiel commentedon Nov 21, 2026
The record above supersedes the earlier apm-scope:v1 record on this issue from today (2026-11-21). It was amended after a precedent review:
--trust-lockfileonly fills missing evidence, never overrides evidence that a file differs, previews in the refusal, and lands with a req-lk-024 spec amendment.chore(changelog): note uninstall --trust-lockfile (#4295)
docs: uninstall --trust-lockfile consent path (#4295)
feat(uninstall): add --trust-lockfile consent for missing deployment …
spec(openapm): 0.1.75 req-lk-024 per-invocation uninstall consent exc…
chore(changelog): note uninstall --trust-lockfile (#4295)
docs: uninstall --trust-lockfile consent path (#4295)
feat(uninstall): add --trust-lockfile consent for missing deployment …
spec(openapm): 0.1.75 req-lk-024 per-invocation uninstall consent exc…
33 remaining items
fix(uninstall): compare retained, failed and consent-kept paths by on…
fix(uninstall): pool case-equivalent claim keys for consent; one repo…
chore(spec): waive Mode B for the #4815 bug fix (#4844)
chore(spec): waive Mode B for the #4815 bug fix (#4844)
chore(spec): waive Mode B for the #4815 bug fix (#4844)
Merge origin/main into danielmeppiel-4295-uninstall-consent
chore(spec): waive Mode B for the #4815 bug fix (#4844)
fix(cleanup): never follow a Cowork final symlink under consent (#4295)
chore(spec): waive Mode B for the #4815 bug fix (#4844)
Merge pull request #4650 from microsoft/danielmeppiel-4295-uninstall-…