Skip to content

perf(plugins): clone an image's skill files into its normalized view (#5838 slice 1c) - #5852

Open
Daniel Meppiel (danielmeppiel) wants to merge 128 commits into
mainfrom
fix-5838-slice1c
Open

Daniel Meppiel (danielmeppiel) wants to merge 128 commits into
mainfrom
fix-5838-slice1c

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 5ef10c643e83d7757b1bd49eda5bf6df42115ae2

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Red-first 0ad2359: on a clone-capable filesystem, normalize wrote a skill file byte by byte; after, none.
↑ The view is an independent file with nlink 1 whether the clone runs or is refused (APM_NO_REFLINK=1), so slice 8's G2 holds unchanged.
↑ AUD SECURITY GO at 5ef10c6 (256 related unit tests, 0 failed).
↑ tests/unit/deps, tests/unit/install, the plugins14 cost module (byte, receipt and lock parity) and test_plugin_e2e: 7,179 passed.
↑ QL verified the clone cell locally on APFS (red at 38fb19b src, green at head).
↑ PR CI and tier2 green at 5ef10c6.
↓ Linux CI runs on ext4, where clones fall back to copies: the saving shows on APFS/btrfs/xfs only.
↓ Rows are not yet confirmed on the train-6 tip it will land on.

Description

Slice 1c of #5838. Stacked on #5850 (then #5843, #5842, #5841, #5839).

Normalize materialized every skill tree of a local plugin image into .apm/skills/ with shutil.copytree (about 166 files and 12 MB on the 14-plugin world). It now uses file_ops.robust_copytree, which clones each file where the filesystem supports copy-on-write (clonefile on APFS, FICLONE on btrfs/xfs) and copies it otherwise (ext4, Windows, any error).

Per the PGM ruling, there are no hard links: a clone is a separate inode with nlink 1, so a later write to either name never shows through the other, and slice 8's verifier (G2, nlink > 1 refused) needs no change.

cost: on a clone-capable filesystem, about -12 MB of copy I/O per 14-plugin install (blocks shared copy-on-write); elsewhere unchanged. The fallback costs one failed clone attempt per device (the result is cached per st_dev).

Oracle (deterministic): test_normalize_clones_skill_files_where_the_filesystem_can counts byte-copy opens of .apm/skills/** at shutil.copyfile's write boundary: 1 on the parent, 0 after. It runs where a clone probe succeeds and skips on ext4. No PR CI lane runs on a copy-on-write filesystem. The only one is build-release.yml's unit-macos-arm job (pytest tests/unit on macOS APFS), which runs on the nightly schedule and on releases, not on PRs; it collects this cell there. For the PR, QL reruns it locally on macOS. test_a_normalized_skill_view_is_an_independent_file[allowed|refused] runs everywhere: same bytes, its own inode, nlink 1.

Issue and approved scope

Issue: Refs #5838 (slice 1c of the floor plan)

Human scope-approval comment: #5838 (comment)

Does this PR complete the issue, or what remains? It does not; later floor-plan slices remain.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass

  • Added tests for new functionality (if applicable)

  • Red-first 0ad2359: the clone cell fails on the parent (1 byte copy); green after.

  • pytest tests/unit/deps tests/unit/install tests/integration/test_local_plugin_install_cost.py tests/integration/test_plugin_e2e.py: 7,179 passed (through local-test.sh, APM_E2E_TESTS=1, with a token).

  • Lint mirror clean: ruff@0.15.12 check and format; pylint R0801; lint-auth-signals.sh; complexity ratchet; architecture boundaries.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…t collected fails

A required cell in tests/quality/harness_conformance.json must earn a passing
receipt. Until now ReceiptWitnessPlugin only checked witnesses that passed, so
a skipped witness left its required cell unproven without failing anything.

- ReceiptWitnessPlugin fails a skipped or xfailed witness of a required cell
  (setup or call phase), naming every cell and the skip reason. A cell that no
  longer applies leaves through the contract (applies()), not a run-time skip.
  Skips of nodes that witness no required cell stay skips.
- harness_ratchet.uncollected_witnesses(): every required witness node must be
  collected (pytest --collect-only over the witness modules), so a renamed or
  unparametrized witness is refused.
- Mutation tests: a required witness that skips fails the gate (pytester), a
  skip outside required cells stays a skip, and a dropped node is named as
  not collected.

Refs #5796

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…easured; plain skips and untracked xfails fail

Refs #5796

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…quired cells

A required cell's witness passes with a receipt, or is a strict
KnownFailure listed in required_known_failing whose tracking equals the
ledger issue, whose issue is open (closed-issue gate), and whose failure
matches. Any other xfail, a skip in any phase, an uncollected node or a
strict XPASS fails. The ledger only shrinks against the merge-base; a
base without the section compares against the frozen 8-cell #5797 set.

Refs #5796

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds src/apm_cli/lens/: model.py, the stdlib-only interface contract of the
apm list inventory (frozen dataclasses Source, Evidence, HarnessRef,
Location, Item, CoverageCell, NotVisible, Inventory), and verdict.py, the
only evidence -> state judgment (state, folder_content, item_state).

Registers the lens-observation owner with guard
registry-delegation-lens-observation: model.py imports only the standard
library, only verdict.py writes an APM health state, and no lens module
writes, deletes, spawns or opens a socket. One mutation case proves it.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
J13 step 1 now runs 'apm run --list' against an O1 golden captured from
today's 'apm list' (the 0.39 scripts table), and asserts it runs nothing.
Step 4's diagnose advice moves to 'apm run --list'.

Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
'apm run --list' prints the 'apm list' scripts table or the No scripts
found panel byte-for-byte, exits 0 and runs nothing, so bare 'apm list'
can switch to the agent-config inventory. The script-not-found hint and
the docs now point to 'apm run --list'.

Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds the test-only R0 layer of the apm list test plan: structured oracles,
pending-witness promises, laws, schema, mutations and static guards. No
committed cells: every HC-LIST promise stays pending-witness, so the
harness ratchet is untouched.

- oracles.Evidence gains json_equal and rows_equal (parsed path plus
  expected value), checked inside check_obligation; a mismatch or an
  unparseable output fails with no receipt.
- tests/lifecycle/list_oracle.py is the one parser of apm list output
  (schema-validated JSON views; text rows by header column spans; summary
  and footer by exact clause and line).
- HC-LIST-01..15 and HC-LIST-03.targets appended to harness_contract.py
  as pending-witness; HC-LIST-07 carries scopes=(user,) with a citation.
- P-LAW-list.* laws in the property catalog as forward laws citing #5745;
  the ledger guard accepts a law only when bug-referenced or forward with
  a cited issue.
- JSON Schema plus 4 outcome fixtures; S137 AST guard; C6 clone proof;
  tests/lifecycle/mutations/list.yaml.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lens/apm_layers.py reads one scope's lockfile once and turns its deployment
ledger rows into logical items: kind and name come from the target layout,
rows for one physical path are deduped (targets kept apart), and
projections of one package item collapse into one item with several
locations. Each unique physical file is classified once through
deps/file_provenance.classify_file (made public at its owner). Folder items
get a bounded recursive name walk without link following: a file outside
the record makes the folder modified, a partial walk leaves it
unverifiable. Recorded values that escape their root are rejected
lexically, before any filesystem call. 'orphaned' is not produced in 0.40
(declared is 'yes' for every locked owner).

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
'apm run --list' no longer imports from list_cmd, whose scripts body goes
away when bare 'apm list' switches to the inventory. The renderer lives
in run.py (a new module would need an architecture owner); output stays
byte-identical. The list_cmd unit cases are ported to test_run_list.py.

Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lens/inventory.build(ctx) reads each requested scope's APM layer once, asks
the reader package for native observations (an empty scan until the readers
land) and joins them: a native observation at or inside a path an APM item
lists is dropped, so one physical path is one location; a scope whose
lockfile is unreadable turns its native items into not-checked. APM
locations take HARNESSES from the reader records and keep ledger targets
apart. --target and NAME selection run before states are summarised, and
under exactly one --target same-name copies get the documented ORDER
(higher/lower with order_rank, coexist, or unknown; a missing copy is
never ranked). The context carries the keys the renderer needs.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…es detection

The build input key for the --target selection is 'harnesses' (the target
vocabulary guard rejects a raw targets read in src). build() resolves the
detected harnesses (signal folders at the project and home roots, apm.yml
targets and ledger targets, kept to harness reader records) and passes the
selection and the detected set to the readers' scan. ORDER under one target
now uses the readers' tier_of and the record's ranked/coexist/unknown rule:
copies in one tier tie, and a copy whose tier cannot be read is unknown.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
MCP ledger rows (uri locators under target mcp, one per runtime) become MCP
claims instead of file items. The inventory joins each claim to the
readers' observation of that server name for that runtime at that scope:
the location takes the observed config path and entry pointer, the
observation is claimed (not listed again as unrecorded), and the entry is
compared with the recorded fingerprint through the ownership owner's
mcp_native_hash, imported only when an entry is compared. Entry values are
read only for that comparison and never returned; the item carries the
readers' keys-only shape. An entry not observed is unverifiable.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark test_run_list.py as component (it writes apm.yml and drives Click),
and keep the docs truthful while bare 'apm list' still lists scripts.

Refs #5756

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Run tests/quality/test_list_{conformance_guards,oracle}.py in the
  ratchet contracts job (ci.yml and merge-train.yml, kept identical).
- P-LAW-list.* forward laws are phase 0: no spine transition covers them
  until the list observation invariant lands.
- list_oracle: the command kind and Commands section; an empty inventory
  summary has no clause; rows() refuses -v detail lines, and details()
  attaches them to the row above.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
User-scope APM items now say they are declared in the $APM_HOME manifest,
shown as ~/.apm/apm.yml when it sits under the home root; project items
keep apm.yml.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The oracle unit test credited a pending-witness cell id; use a neutral
cell id so the pending-witness leak guard stays clean.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Under -g the project scope has no root, so context.roots values may be
null. Reader order rules name the item kind (skill), unlike sources
(skills); HC-LIST-10 now applies where a skill rule is recorded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…paths

- Item names drop any extension the registry gives the primitive, so one
  instruction deployed as name.instructions.md and name.md is one item.
- ORDER ranks each copy by the tier of its best location the target reads;
  only copies sharing a best tier tie.
- Recorded paths that map to no primitive layout, and paths not confined to
  their root, are coverage cells, never a made-up 'file' item; 'canvas'
  joins the kind vocabulary.
- User-scope rows under $HOME are matched under the target root install
  resolves (root variables such as CLAUDE_CONFIG_DIR honoured).
- Path dedupe and the ancestor manifest hint are separator-agnostic
  ('../apm.yml' on every OS).
- The folder walk cap is a read_layer parameter, so tests pass it instead
  of patching the owner.

Refs #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…rows

Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Link ownership through path_security.user_owned_link, native activation keys
from native_plugins.settings, no target-vocabulary reads, records.py counted
as registry data by the harness-literal guard, and a vendor file name is not
the removed plugin-lifecycle symbol.

Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…eeps its teeth

Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…olders by descriptor

Folds AUD F1-F3: the managed-settings ownership gate is re-checked on fstat,
subfolders below a root are opened O_NOFOLLOW and listed by descriptor, and the
tombstone exemption applies only to the quoted installed_plugins.json name.

Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… evidence

not_visible[].os and record OS rows use linux, macos and windows (sys.platform
mapped once). A plugin activation entry in a settings file now sets configured
and evidence_source on the install record with the same plugin id (narrowest
scope, then the file read last); an entry with no install record is one plugin
item with present no. Install records carry plugin@marketplace ids. Tests are
Windows-safe (bytes for frontmatter, absolute tmp system paths).

Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5746, #5754

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ine bypass

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
APM_E2E_TESTS=1 turns the update notice off, so these cells failed in
any session that set it for the serve_offline perf modules. They now
clear it for themselves.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…irst)

Resolve walks every component of a path into directories not created
yet, even below a directory this command already proved link-free: on
the 14-plugin world that is about 470 full walks before the writes.
The cells expect one lstat for the first missing component, the same
answer as Path.resolve(), and no proof past a link, a file or a
volatile component.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A path whose directory is not proven yet was resolved by a full walk.
Below this command's deepest proven ancestor, each component now costs
one lstat: an existing plain directory is proven, the first missing
component ends the walk (nothing below it exists, so the path resolves
to itself), and a link, a file, a volatile name or an error takes the
full resolve as before. Linux keeps its kernel form.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… (red-first)

Each recorded path resolved the project root again: 20 locators, 20
root resolves. The cells expect one per command, and a root that an
APM rename released and a link replaced to be resolved afresh.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The locator resolved the project root, and an external deploy root, for
every path it encoded. realpath.resolve_root keeps a root's answer for
the command and drops it with the link-free proofs, so any rename,
delete or recreate APM performs resolves it afresh. File paths are still
resolved on every call.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The B3 count cell patched the owner's resolve_path (AQ004); it now
counts lstat calls on the root under the proof form. The path_home
rows take the values Linux PR CI measured at d8e0f0b (337 and 71).

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A regular file, a volatile directory and an unreadable component below
a proven directory each fall back to the full resolve and prove
nothing; a link later swapped into the volatile directory is refused.
A root resolve parked across a forget and a swap is never recalled.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse must refuse a synthesized path that merely contains the staging
slot (for example "<slot>-skill"), and the per-command root memo must
not share an answer between two spellings of a relative root after a
chdir.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse now refuses a synthesized path that contains the staging slot
anywhere, not only as a whole segment, and resolve_root keys its memo on
the absolute path so two spellings of a relative root never share an
answer. Both are AUD review nits, cost 0.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 3, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Dec 3, 2026
On a filesystem that can clone (APFS, btrfs, xfs), normalize still
copied every skill file of a local plugin image into .apm/skills byte
by byte. The cells expect no byte copy there, and an independent file
with nlink 1 whether the clone runs or is refused.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normalize materializes .apm/skills with robust_copytree, which clones
each file (clonefile on APFS, FICLONE on btrfs/xfs) and copies it where
the filesystem cannot (ext4, Windows, any error). The view is always an
independent file with nlink 1; nothing is hard-linked.

Refs #5838

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@danielmeppiel Daniel Meppiel (danielmeppiel) changed the title perf(plugins): link an image's skill view to its raw files (#5838 slice 1c) perf(plugins): clone an image's skill files into its normalized view (#5838 slice 1c) Dec 3, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) marked this pull request as ready for review December 3, 2026 19:44
Copilot AI balanced review requested due to automatic review settings December 3, 2026 19:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Reflink normalization can hang on FIFOs, and lockfile memoization can return stale deployment paths after configuration-root changes.

2 open issues
What changed in this PR

Reduces local-plugin installation work for #5838 by cloning skill files into normalized views where supported, with ordinary copies as fallback. The supplied changes also include earlier install optimizations and the read-only apm list transition.

Changes:

  • Use copy-on-write cloning without hard links.
  • Reuse plugin images and reduce repeated scanning, discovery, and path resolution.
  • Add inventory contracts, script-list migration, documentation, and regression guards.
File Description
tests/​unit/​scripts/​test_architecture_runner.py Register the lens guard.
tests/​unit/​scripts/​test_architecture_removed_plugin_tombstone.py Test removed-symbol enforcement.
tests/​unit/​scripts/​test_architecture_harness_literals.py Allow reader registry literals.
tests/​unit/​lens/​test_verdict.py Test inventory state judgments.
tests/​unit/​lens/​test_model.py Enforce lightweight model imports.
tests/​unit/​lens/​readers/​test_reader_records.py Validate reader record contracts.
tests/​unit/​lens/​readers/​__init__.py Initialize reader tests.
tests/​unit/​lens/​_list_fixtures.py Share synthetic inventory fixtures.
tests/​unit/​lens/​__init__.py Initialize lens tests.
tests/​unit/​integration/​test_hook_shared_scope_claims.py Isolate memo behavior tests.
tests/​unit/​install/​test_sources_selection.py Initialize plugin-reuse test context.
tests/​unit/​install/​test_sources_materialisation.py Initialize plugin-reuse test context.
tests/​unit/​core/​test_runnable_prompts.py Update script-list guidance assertion.
tests/​unit/​core/​test_remediation_commands_catalog.py Register inventory remediation coverage.
tests/​unit/​core/​test_output_mode.py Isolate update-notice tests.
tests/​quality/​test_lifecycle_bug_ledger.py Validate forward lifecycle laws.
tests/​quality/​test_known_cells_cite_open_issues.py Check forward-law issue tracking.
tests/​quality/​promise-catalog.json Register inventory and performance promises.
tests/​quality/​known_cell_issues.py Track forward laws and conformance failures.
tests/​quality/​known_cell_issue_states.json Add tracking issue states.
tests/​quality/​generated_obligations.json Register script-list golden obligation.
tests/​lifecycle/​scenarios/​_list_kit.py Share inventory lifecycle fixtures.
tests/​lifecycle/​oracles.py Compare parsed inventory output.
tests/​lifecycle/​obligations.py Enforce required witness execution.
tests/​lifecycle/​machines/​_spine_kit.py Check inventory against lifecycle state.
tests/​lifecycle/​list_contract/​fixtures/​no-match.json Define no-match JSON example.
tests/​lifecycle/​list_contract/​fixtures/​error.json Define usage-error JSON example.
tests/​lifecycle/​list_contract/​fixtures/​drift-unknown.json Define drift and uncertainty examples.
tests/​lifecycle/​list_contract/​fixtures/​clean.json Define clean inventory example.
tests/​lifecycle/​journeys/​index.yaml Update script-list journey index.
tests/​lifecycle/​journeys/​goldens/​J13/​01.txt Capture script-list output.
tests/​lifecycle/​journeys/​consumer/​J13-run-scripts.yaml Exercise script-list migration.
tests/​lifecycle/​driver.py Support user-scope inventory invocation.
tests/​integration/​test_remaining_modules_coverage.py Initialize plugin-reuse test contexts.
tests/​integration/​test_perf_count_budgets.py Add multi-plugin performance journeys.
tests/​integration/​test_local_bundle_hooks_lifecycle.py Clarify inventory coverage in comments.
tests/​integration/​test_list_import_diet.py Check lightweight inventory imports.
tests/​integration/​test_install_sources_classification.py Initialize plugin-reuse test context.
tests/​integration/​test_failure_next_step_lifecycle.py Verify runnable script-list advice.
tests/​integration/​test_coverage_phase4.py Remove migrated script-list tests.
tests/​integration/​test_architecture_pack_lockfile_read.py Recognize the lockfile memo owner.
tests/​integration/​test_architecture_owner_rule_mutations.py Test lens guard mutation detection.
tests/​integration/​test_architecture_lockfile_write_authority.py Update guarded reader expectation.
tests/​fixtures/​perf/​plugins.py Build deterministic multi-plugin fixtures.
tests/​fixtures/​perf/​counters.py Collect engine call counters.
tests/​fixtures/​perf/​count_budgets.py Register plugin journeys and counters.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.text_json_agree.json Declare output agreement law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.scripts_transition.json Declare script-list migration law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.read_only.json Declare read-only inventory law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.nondisclosure.json Declare output nondisclosure law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.json_contract.json Declare inventory JSON contract.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.hostile_input.json Declare hostile-input handling law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.honesty_vocabulary.json Declare inventory vocabulary restrictions.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.extra_files.json Declare extra-file detection law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.exit_contract.json Declare inventory exit codes.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.confinement.json Declare filesystem confinement law.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.ci_isolation.json Declare CI scope isolation.
tests/​fixtures/​lifecycle_bug_ledger/​property_catalog/​list.audit_is_the_gate.json Distinguish inventory from audit enforcement.
tests/​benchmarks/​spawn_counter/​sitecustomize.py Instrument thread-safe engine call counts.
src/​apm_cli/​utils/​realpath.py Reuse directory proofs and root resolutions.
src/​apm_cli/​utils/​path_security.py Reduce repeated HOME and root resolution.
src/​apm_cli/​utils/​content_hash.py Expose hashed payload membership.
src/​apm_cli/​security/​content_scanner.py Scan suspicious Unicode with regex.
src/​apm_cli/​primitives/​discovery.py Share one discovery inventory.
src/​apm_cli/​lens/​verdict.py Centralize inventory state judgments.
src/​apm_cli/​lens/​ci_scope.py Define inventory CI detection.
src/​apm_cli/​lens/​__init__.py Introduce lightweight observation package.
src/​apm_cli/​integration/​prompt_integrator.py Defer unnecessary link-resolver initialization.
src/​apm_cli/​integration/​instruction_integrator.py Defer unnecessary link-resolver initialization.
src/​apm_cli/​integration/​agent_integrator.py Defer unnecessary link-resolver initialization.
src/​apm_cli/​integration/​__init__.py Load integration exports lazily.
src/​apm_cli/​install/​sources.py Reuse validated local plugin images.
src/​apm_cli/​install/​source_helpers.py Avoid repeated local digest recording.
src/​apm_cli/​install/​run_memos.py Centralize install memo resets.
src/​apm_cli/​install/​pipeline.py Reset memos at pipeline entry.
src/​apm_cli/​install/​phases/​resolve.py Record reusable plugin images.
src/​apm_cli/​install/​phases/​finalize.py Skip unnecessary global-instruction discovery.
src/​apm_cli/​install/​local_plugin_image.py Validate same-run plugin image reuse.
src/​apm_cli/​install/​context.py Store reusable plugin image records.
src/​apm_cli/​deps/​registry/​config_loader.py Memoize unchanged registry YAML parsing.
src/​apm_cli/​deps/​plugin_parser.py Clone normalized skill trees when supported.
src/​apm_cli/​deps/​lockfile.py Memoize lockfile document construction.
src/​apm_cli/​deps/​lockfile_write_authority.py Invalidate memoized reads after writes.
src/​apm_cli/​deps/​lockfile_read_memo.py Cache independent lockfile snapshots.
src/​apm_cli/​deps/​file_provenance.py Share deployed-file classification.
src/​apm_cli/​core/​script_runner.py Recommend apm run --list.
src/​apm_cli/​core/​remediation.py Add missing-inventory-item remediation.
src/​apm_cli/​core/​deployment_ledger.py Reuse containment-root resolutions.
src/​apm_cli/​commands/​run.py Add script listing without execution.
src/​apm_cli/​commands/​deps/​__init__.py Load dependency commands lazily.
src/​apm_cli/​commands/​__init__.py Remove eager command imports.
src/​apm_cli/​cli.py Update inventory help and offline dispatch.
scripts/​architecture_linter/​groups/​registry_delegation.py Register lens observation checks.
scripts/​architecture_linter/​checks/​registry_lens_observation.py Guard read-only observation boundaries.
scripts/​architecture_linter/​checks/​registry_harness_literals.py Recognize reader records as registry data.
scripts/​architecture_linter/​checks/​marketplace_bundle_and_audit.py Exempt the vendor install-record filename.
scripts/​architecture_linter/​checks/​contracts_lockfile_write_authority.py Guard the extracted document reader.
scripts/​architecture_linter/​checks/​contracts_lockfile_regular_read.py Update canonical read-route checks.
scripts/​architecture_linter/​checks/​contracts_lockfile_generator.py Update version-warning route checks.
packages/​apm-guide/​.apm/​skills/​apm-usage/​commands.md Document inventory and script-list commands.
docs/​src/​content/​docs/​troubleshooting/​index.md Explain inventory versus package listing.
docs/​src/​content/​docs/​troubleshooting/​common-errors.md Update script-discovery remediation.
docs/​src/​content/​docs/​reference/​cli/​run.md Document run --list.
docs/​src/​content/​docs/​reference/​cli/​preview.md Update script-list reference.
docs/​src/​content/​docs/​integrations/​canvas.md Describe installed canvas inventory visibility.
docs/​src/​content/​docs/​consumer/​install-packages.md Update script-list command reference.
changelog.d/​5852.fixed.md Announce copy-on-write skill normalization.
changelog.d/​5850.fixed.md Record staging-name and root-key fixes.
changelog.d/​5843.fixed.md Record reduced HOME lookups.
changelog.d/​5842.fixed.md Record deferred link-resolver initialization.
changelog.d/​5841.fixed.md Record discovery and memo optimizations.
changelog.d/​5839.fixed.md Record plugin reuse and scanning improvements.
changelog.d/​5812.breaking-changes-and-upgrade-notes.md Explain script-list migration.
changelog.d/​5812.added.md Announce read-only inventory.
changelog.d/​5806.added.md Announce run --list.
.github/​workflows/​merge-train.yml Run inventory quality guards.
.github/​workflows/​ci.yml Run inventory quality guards.
.apm/​architecture/​owners/​install-deployment.json Register plugin reuse and memo ownership.
.apm/​architecture/​owners/​core-runtime.json Register lens observation ownership.
.apm/​architecture/​owners/​contracts-tooling.json Register lockfile read memo ownership.

Review effort: Balanced

continue
shutil.copytree(directory, dest, dirs_exist_ok=True, ignore=ignore_non_content)
# A clone (copy-on-write) where the filesystem can, else a copy: never a link.
robust_copytree(directory, dest, dirs_exist_ok=True, ignore=ignore_non_content)
Comment on lines +35 to +39
def _version(path: Path, kind: str, payload: Any) -> tuple[str, Any, tuple[bool, str]]:
"""*payload* plus the inputs adoption reads besides the bytes (user scope, home)."""
from ..core.scope import is_user_scope_root

return (kind, payload, (is_user_scope_root(path.parent), str(Path.home())))
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Dec 3, 2026
# Conflicts:
#	tests/unit/install/test_local_plugin_image.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants