Repository navigation
fix(install): one owner and one message for a kept edited file - #4504
Merged
Daniel Meppiel (danielmeppiel) merged 6 commits intoNov 20, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 6 commits into
Daniel Meppiel (danielmeppiel) merged 6 commits into
Conversation
base_integrator.kept_edit_message is the single owner of the message install prints when it keeps a managed file: 'Kept <file>: <reason>. Move it aside, then run 'apm install' to restore it; or run 'apm install --force' to overwrite it.' The #4360 unproven reason is unchanged; a receipted skill member modified since APM deployed it now uses the same shape instead of the non-runnable 'Preserve your changes before reinstalling with --force'. A kept edit warns (exit 0) only when the package brings the same bytes APM deployed (drift); when it brings new bytes for the edited file (an upgrade) the kept edit blocks the requested state and install exits 1. The integrity cell deployed_file_hashes|install|disk-or-cache is re-pointed at the message; checkout-switch R2/R4 pin the exit 1. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 20:20
Co-authored-by: Copilot App <[email protected]>
…the new bytes Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…shape Kept lines now read 'Kept <path>: <reason>. <Remedy sentence>', the shape of base_integrator.kept_edit_message (#4504), through a shared remediation.kept_file_message template. Tests pin the full aligned lines. Co-authored-by: Copilot App <[email protected]>
A receipted member whose bytes differ from the recorded hash but equal the package's bytes holds no edit to keep: it is rewritten and recorded (adopted), with no 'Kept' line. _member_edit classifies members as untrusted, drift (warn, exit 0) or blocked (error, exit 1). Co-authored-by: Copilot App <[email protected]>
…eppiel-kept-edit-message # Conflicts: # docs/src/content/docs/enterprise/drift-detection.md
…alog kept_edit_message renders through remediation.kept_file_message with the kept-file-restore and kept-file-overwrite catalog entries, the one kept- file shape the frozen kept lines share. The template joins the two remedies with ', or'; pins follow. _member_edit keeps the guarded '(baseline_hash is not None and expected is None)' predicate. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
The #4504 merge brought differing_unrecorded_native_mcp_entries (#4477) into install/mcp/ownership.py, calling the native-entry probes that 9c01d5e moved to install/mcp/native_entry.py, which left undefined names, and pushed ownership.py to 1009 lines (install budget 1000). The function moves beside those probes (same owner); audit's ci_checks imports it from there. ownership.py is back to 958 lines. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
merged commit Nov 20, 2026
378303b
into
train/0.37-final-2
5 checks passed
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…ard fix-ups (04daadaf) Co-authored-by: Copilot App <[email protected]> # Conflicts: # .apm/architecture/owners/contracts-tooling.json
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
#4504's variadic form is a superset; drop the narrower duplicate. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-kept-edit-message
branch
November 20, 2026 21:52
5 of 9 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…mutation - test_frozen_no_rewrite_e2e: the kept line follows the one kept-file shape (#4504): asserted through frozen_withdrawal.kept_lines, plus its reason text; the rerun asserts neither "kept" nor "Kept". - Steward ruling (9c01d5e wins): test_adopted_identical_files_get_no_receipt becomes test_adopted_identical_files_get_a_receipt. For every _ADOPTABLE file: the receipt hash equals sha256 of the disk bytes, no "Kept" line, audit --ci is clean, and apm uninstall removes them with no refusal. New negative: test_a_differing_file_is_never_receipted_by_adoption. - Product: hook_bundle's identical-script adoption records the receipt for MANAGED scripts too (same rule as _check_adopt_or_skip in 9c01d5e). - test_architecture_owner_rule_mutations: the update.py scope-manifest case pins the unique enforce_declared_policy argument (update.py now holds the fragment twice); the rule is AST-based, so one site trips it. Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Install printed two different messages for the same outcome, a managed file kept because it holds local edits:
Per the steward ruling,
base_integrator.kept_edit_message(entry, *, user_scope, proven_edit)is now the single owner. Every call site uses it:copy_directory_files);_check_adopt_or_skip;The message has one shape: "Kept : . Move it aside, then run 'apm install[ -g]' to restore it; or run 'apm install[ -g] --force' to overwrite it." The #4360 reason text is unchanged. A receipted edit reads "it was modified since APM deployed it".
Exit code (steward precision):
Issue and approved scope
Issue: Refs #4360
Human scope-approval comment: the steward ruling on the train-2 red
I|deployed_file_hashes|install|disk-or-cachewas relayed by the 0.37 Hardening PM (one owner, one message, cell re-pointed, exit-code split).Does this PR complete the issue, or what remains? It completes the message unification. Nothing remains for this ruling.
Type of change
Testing
pytest "tests/lifecycle/security/test_integrity.py::test_integrity_row[I|deployed_file_hashes|install|disk-or-cache]" tests/integration/test_checkout_switch_skill_lifecycle.py tests/integration/test_skill_materialization_receipt_lifecycle.py: 44 passed, 1 xfailed.python -m tests.lifecycle.witnesses: up to date.Per-cell classification:
I|deployed_file_hashes|install|disk-or-cache: re-pointed from the cleanup line "Kept user-edited file" (wrong owner) to the install owner's message plus its next step. Still exit 0 with_SKILL_STATEunchanged. It is red on train-2, where the output is "Skipped ... modified since deployment".test_user_edit_variants_never_lose_bytes[R2,R4]: the source brings new bytes for the edited SKILL.md, so the expected exit goes from 0 to 1 per the ruling. The no-loss assertions are unchanged. R1 and R3 stay at exit 0.test_checkout_switch_skill_lifecycle._MODIFIEDandtest_skill_materialization_receipt_lifecycle: the message pin follows the new wording. Assertions are otherwise unchanged.Changelog
## [Unreleased].Spec conformance (OpenAPM v0.1)
Agent note, not authored by Daniel.