Repository navigation
test(perf): stop counting import-system I/O; add scandir and read counters (#5838) - #5847
Open
Daniel Meppiel (danielmeppiel) wants to merge 110 commits into
Open
Daniel Meppiel (danielmeppiel) wants to merge 110 commits into
Daniel Meppiel (danielmeppiel) wants to merge 110 commits into
Conversation
…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>
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>
…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>
…ine bypass Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Slice 3, step 2 of #5838. LockFile.read keeps one immutable snapshot (the pickled, adopted lockfile) per document version and returns an independent copy per read, so mutating one result never reaches another. A version is the writer's staged entry (by identity: every stage is new), else the file's (mtime_ns, size, inode, device): an APM write, a stage or an external rewrite is always read again. Symlinks, missing files and removed stages are never memoized; _note_rows still runs on every read. install/run_memos.py is the one reset of every run memo (perf counters, discovery, lockfile reads, registry parses) at pipeline start. The lockfile contract rules now check LockFile._read_document, which kept the staged, warn_if_newer and read_lockfile_text routes. cost: one lstat per read; on the 14-plugin world 19 reads build 5 LockFile objects (one per version the run writes) instead of 19, and apm.lock.yaml disk opens drop 19 -> 13 (the rest are raw-text readers). Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Reuse requires resolve's graph to hold the package at exactly the recorded destination, and integrate to read that same path (cost 0). - Move the record call to one line so install/phases/resolve.py stays at its 1001-line budget. - Add fs budget rows for the plugins14 journeys, measured on Linux PR CI. - Give the LocalDependencySource ctx stubs a resolved_local_plugins map. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Security folds on #5841: - both memo signatures (lockfile reads, registry YAML) add st_ctime_ns, so a same-size in-place rewrite that restores the mtime is read again; no API sets the ctime, and it costs no extra syscall; - the write authority's commit, remove and restore paths, and an unscoped LockFile.write, forget the remembered read for that path, so APM's own writes invalidate regardless of timestamp granularity or inode reuse. cost: 0 (same lstat; one dict pop per write). Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
fs.lockfile_reads for the local plugin world, red on #5839's head: - install-g-14-plugins: 19 -> 13 (budget 14); - install-g-23-plugins-repass: 24 -> 9 (budget 10). LockFile.read now builds each document version once per run. Counted on the same hermetic world (base 19 / 25, head 13 / 9); lstat moves by about 4% here, inside the 5% slack, so its rows stay. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mutate a recalled copy, not only the object the build returned, and assert the next recall and a fresh read still hold every row. A recall that shared one object per snapshot now fails. Test-only; src is unchanged. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…istic Resolve copies local packages on parallel workers. The calls table kept one shared nesting depth and an unlocked increment, so concurrent copies were counted or dropped at random (9 and 13 on Linux CI for the same build). Depth is now per thread and increments are locked. Copytree is exactly one per local plugin: 14 and 23, against 28 and 46 on main. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…memo test_n_shared_configs_with_deep_paths_read_the_other_lock_once pins that the command (invocation) memo reads the other scope's lockfile once across N configs, with a no-memo control reading it N times. The run's LockFile.read memo (#5838) now also dedupes those opens, which made the control read once. Clear that memo before each call in both arms, so the one-versus-N contrast stays the command memo's alone. Test-only. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Windows CI showed stat signatures cannot tell a same-size in-place rewrite apart: NTFS mtime ticks are 100 ns and os.stat's st_ctime is the creation time there; Linux's coarse kernel clock leaves the same gap within a tick. Per AUD (K1-K4): - LockFile._read_document reads the text through read_lockfile_text on every read (its link and regular-file refusals included) and recalls only when the full text is identical; only parse, validation, build and adoption are memoized; - the key also carries adoption's other inputs: whether the path is the user scope root, and the home directory; - the registry YAML memo reads the file each call and reparses only when its text changed; - staged-entry identity, the forget on commit/remove/restore, pickled independent copies and the clear at pipeline start are kept. The plugin journeys' fs.lockfile_reads rows return to #5839's values: every read now reads the file, and the saving is the build (19 reads build 5 LockFile objects on the 14-plugin world, 19 on #5839). cost: one raw read per LockFile.read, as before #5838; no stat calls. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve normalizes a local plugin in a staging directory with an opaque name. Normalization names a root-declared skill, and a manifest without a name, after the directory it runs in, so reusing that image deployed the root skill a second time under the staging name. Reuse now refuses an image whose synthesized paths or metadata carry the staging name; integrate normalizes it at its destination as before. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve normalizes a local plugin in an opaque staging slot. A root-declared skill installed at user and project scope deploys once, under the plugin's name, and is normalized again at its destination. Red at bcd7a45 (the slot name deployed as a second skill). Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The staging-name check read only apm.yml and the top-level .apm metadata. It now reads every file normalization added, by path and by content; a file that cannot be read as text still refuses reuse. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The fs counters' open hook counted importlib's own I/O: on a cold checkout every imported module's __pycache__ bytecode write (an os.open of <name>.pyc.<id>, then FileIO on its descriptor) landed in files_written, about 1,420 against 778 warm. Opens whose Python caller is the frozen import system are no longer counted, which also keeps module source and bytecode reads out of the new open_reads counter. New counters for the #5838 floor work: fs.scandir_calls (os.walk lists through os.scandir) and fs.open_reads (files opened for reading). Red-first: test_the_fs_counters_skip_the_interpreters_bytecode_writes runs a cold then a warm import and requires equal counts (the old hook counted 4 cold vs 2 warm). Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The fs hook now steps over its own frames (at most four) to the first Python caller instead of reading a fixed sys._getframe depth, and only that caller decides: module code an import executes still counts. Guard cell: a write a module makes at import time, and a program's write into a __pycache__-named path, both still count in files_written; the filter keys on the import system as caller, not on the path. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Linux PR CI Lifecycle Smoke rows for every journey (#5847): - fs.files_written re-measured without the import system's I/O: cold journeys drop most (install-cold 1337 -> 1119, install-50-skills 419 -> 278, update 338 -> 220, install-noop 26 -> 8, outdated 22 -> 4); five rows measured 1-3 higher than their earlier rows and keep their existing budgets; - fs.scandir_calls and fs.open_reads: first rows, the max of two runs (scandir is exact; reads vary by up to 2). Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
force-pushed
the
perf-5838-harness-pyc
branch
from
December 3, 2026 17:06
67fa536 to
5dd1104
Compare
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
December 3, 2026 17:36
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The performance-harness changes have no active review issues.
No open issues 🎉
What changed in this PR
Improves APM’s performance harness for #5838 by excluding import-system I/O from file-open counters. This is stacked on #5841; the supplied diff also includes earlier install optimizations and their tests.
Changes:
- Excludes import-system opens while preserving program I/O counts.
- Adds
fs.scandir_callsandfs.open_readscounters. - Adds regression coverage and recalibrates budgets without increasing existing limits.
| File | Description |
|---|---|
| tests/unit/test_install_run_memos.py | Tests memo reuse, freshness and isolation. |
| tests/unit/test_content_scanner_cost.py | Verifies scanner equivalence and bounded work. |
| tests/unit/integration/test_hook_shared_scope_claims.py | Isolates command-memo read counts. |
| tests/unit/install/test_sources_selection.py | Updates mock install context. |
| tests/unit/install/test_sources_materialisation.py | Updates mock materialization context. |
| tests/unit/install/test_local_plugin_image.py | Tests safe plugin-image reuse. |
| tests/quality/promise-catalog.json | Registers performance promises. |
| tests/perf/count_budgets.json | Recalibrates writes and adds counter budgets. |
| tests/integration/test_remaining_modules_coverage.py | Updates mock contexts for image reuse. |
| tests/integration/test_perf_count_budgets.py | Tests import filtering and plugin budgets. |
| tests/integration/test_local_plugin_install_cost.py | Checks plugin work counts and deployed state. |
| tests/integration/test_install_sources_classification.py | Updates source-classification mock context. |
| tests/integration/test_architecture_pack_lockfile_read.py | Recognizes the lockfile memo owner. |
| tests/integration/test_architecture_lockfile_write_authority.py | Updates the guarded reader name. |
| tests/fixtures/perf/plugins.py | Builds deterministic multi-plugin fixtures. |
| tests/fixtures/perf/counters.py | Exposes counters and documents import exclusions. |
| tests/fixtures/perf/count_budgets.py | Adds plugin journeys and counter flattening. |
| tests/benchmarks/spawn_counter/sitecustomize.py | Filters import opens and instruments additional operations. |
| src/apm_cli/utils/content_hash.py | Exposes hashed payload paths. |
| src/apm_cli/security/content_scanner.py | Uses regex matching for suspicious characters. |
| src/apm_cli/primitives/discovery.py | Shares one inventory across primitive types. |
| src/apm_cli/install/sources.py | Reuses eligible resolved plugin images. |
| src/apm_cli/install/source_helpers.py | Preserves recorded local-copy digests. |
| src/apm_cli/install/run_memos.py | Centralizes per-run memo resets. |
| src/apm_cli/install/pipeline.py | Invokes the shared reset. |
| src/apm_cli/install/phases/resolve.py | Records local plugin images before normalization. |
| src/apm_cli/install/phases/finalize.py | Skips unnecessary compile-hint discovery. |
| src/apm_cli/install/local_plugin_image.py | Validates eligibility for normalized-image reuse. |
| src/apm_cli/install/context.py | Stores resolved plugin-image records. |
| src/apm_cli/deps/registry/config_loader.py | Memoizes registry parsing by content. |
| src/apm_cli/deps/lockfile.py | Reuses independent lockfile snapshots. |
| src/apm_cli/deps/lockfile_write_authority.py | Exposes staged identity and invalidates reads. |
| src/apm_cli/deps/lockfile_read_memo.py | Implements content-keyed lockfile snapshots. |
| scripts/architecture_linter/checks/contracts_lockfile_write_authority.py | Retargets the staged-read guard. |
| scripts/architecture_linter/checks/contracts_lockfile_regular_read.py | Retargets the regular-file reader guard. |
| scripts/architecture_linter/checks/contracts_lockfile_generator.py | Retargets the version-warning guard. |
| changelog.d/5841.fixed.md | Documents inherited memo optimizations. |
| changelog.d/5839.fixed.md | Documents inherited plugin and scanner optimizations. |
| .apm/architecture/owners/install-deployment.json | Registers image reuse and memo-reset ownership. |
| .apm/architecture/owners/contracts-tooling.json | Registers lockfile memo ownership. |
Review effort: Balanced
Re-measured every fs.scandir_calls and fs.open_reads row on the composed train-5 tip ace1dbb (Linux PR CI Lifecycle Smoke), budget = measured + 5%. The earlier rows were measured on this PR's own base, which lacked the train links underneath. Bisected per link: - #5837 (train 3 B3) lists each deployed skill root once more: install-50-skills 654 -> 704 (+50), cold/warm installs +40, install-g-50-skills +50, plugin journeys +78 / +132; - #5842 (train 5 B5) removes listings: install-g-50-skills -160, install-g-14-plugins -543, repass -1031; plugin reads -27 / -44; - no other link moves these counters; other open_reads moves are run-to-run variation of up to 3. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
force-pushed
the
perf-5838-harness-pyc
branch
from
December 3, 2026 19:03
18269b4 to
66def9d
Compare
This branch has not been deployed
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
Harness fix for #5838 (train 5). Stacked on #5841 (60f4ded): review only
aebfa5cd,f72046feand5dd1104a;05fb4860merges signed #5834 5b83983 for train 5 (catalog sorted union only).__pycache__bytecode write landed infs.files_written(about 1,420 cold vs 778 warm). The write is two audited opens,os.open(<name>.pyc.<id>)and thenFileIO(fd)audited with the fd number, so a path filter cannot catch it.__pycache__-named path, still count.fs.scandir_calls(os.walklists throughos.scandir) andfs.open_reads(files opened for reading, import I/O excluded).cost: harness only; no product code changes. One frame walk of at most four frames per audited open, in counted runs only.
fs.files_written, old -> new (Linux PR CI Lifecycle Smoke)No budget grows. The five rows measured 1-3 higher keep their existing budgets, which still cover the new value within slack. Why each grew:
fs.files_writtenwas identical across both CI runs wherever both reported it (install-50-skills 278/278, install-cold 1119/1119, install-noop 8/8, outdated 4/4, uninstall-50-skills 11/11, update 220/220).fs.scandir_callsandfs.open_readsget first rows for every journey, at the max of two CI runs (scandir is exact; reads vary by up to 2).Issue and approved scope
Issue: Refs #5838
Human scope-approval comment: #5838 (comment)
Does this PR complete the issue, or what remains? No; this is harness work for the remaining slices.
Type of change
Testing
Red-first
test_the_fs_counters_skip_the_interpreters_bytecode_writes: a cold and a warm import must count the same (the old hook gives 4 vs 2; the fix gives 2 and 2). Guardtest_the_fs_counters_still_count_program_writes_into_bytecode_paths: an import-time write and a write intoskill/__pycache__/run.cpython-312.pycboth count (program minus bare is 2). The module is Linux-only, so both scenarios were also checked by hand on macOS.tests/unit/test_perf_count_budgets.py: 18 passed.Changelog
changelog.d/<pr>.<section>.md.Spec conformance (OpenAPM v0.1)
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com