Repository navigation
scratch: measure #5849@dc9d4620 (fix) perf rows on d7b9a2fb + #5843@a3c1bbd9 (do not merge) - #5854
Closed
Daniel Meppiel (danielmeppiel) wants to merge 250 commits into
Closed
Daniel Meppiel (danielmeppiel) wants to merge 250 commits into
Daniel Meppiel (danielmeppiel) wants to merge 250 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>
A venv borrowed from another worktree runs that worktree's src/apm_cli, and subprocesses that drop PYTHONPATH import it too, so local results silently disagree with CI. tests/conftest.py now calls require_local_apm_cli before any conftest or test module imports apm_cli: a src/apm_cli outside this checkout fails the session with the uv sync recipe. Installed builds and in-checkout copies such as mutmut's mutants/src are allowed. A pytester case runs an inner session with a foreign apm_cli first on sys.path and checks the hint. Fixes #5808 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>
Run the real tests/conftest.py in a subprocess with a foreign src/apm_cli first on PYTHONPATH; the session must fail with the hint. Replacing the require_local_apm_cli call in tests/conftest.py with pass turns this case red (QL C1 on #5809). Refs #5808 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>
The pure foreign_source_root cases move to a unit-marked tests/unit module, and the two session cases that spawn pytest (pytester and the real-conftest wiring proof) move to tests/integration/test_source_tree_guard_session.py, keeping the component mark and P-INV-I7 (QL on #5809: tm006 process spawn in tests/unit, AQ003 on return-value-only component cases). Refs #5808 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>
… (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>
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>
…st (#5838) Every file of a sealed local plugin image is bound to its verified digest, and write_seam.copy2 copies a bound member only from bytes that hash to it. The unchanged-skip judges a bound member by that digest instead of re-reading the image, so a deployment edited to match a swapped member is never adopted. A closed-world rule keeps install reading apm.yml only through read_manifest_text, the reader that serves a sealed image's verified manifest. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…deterministically (#5838) load_yaml and load_yaml_roundtrip serve a sealed image's verified bytes, so every package-manifest reader, not only read_manifest_text, ignores a swap. A copy of a synthesized file under a sealed root writes its sealed bytes. The manifest-read rule now covers the package-image readers outside install with a reasoned allowlist. The swap cells pin each branch: a swap seen at integrate re-materializes from source, and a later swap fails closed. 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>
…5849) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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>
…ity once - The normalization build stamp moves out of the plugin image to <cache_root>/normalized-images/<sha256(resolved path)>.build. It stores the build stamp plus the resolved image path, which must match exactly. It is written with a same-directory temp file and os.replace, and refused below any linked cache component. It is read with lstat, S_ISREG, O_NOFOLLOW|O_NONBLOCK and a bounded read; anything else is a stale build. It is removed when APM rewrites, uninstalls or prunes the image. An APM-created .apm/ in the image made validation skip plugin normalization, so declared skills never deployed. - _build_identity is computed once per process under a lock, with an explicit reset seam for tests that edit the source tree. - Seal keys are normcase-normalized; on Windows the image walk reads st_nlink through lstat because scandir reports 0. - Re-pass warning parity: images with a skills declaration stay on the full path, so their normalization and shadowing warnings repeat. - POSIX-only image cells skip on Windows. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A Windows junction lstats as a directory with st_reparse_tag set; the image walk now refuses any entry carrying a reparse tag, so a junction inside the image reads IMAGE_DIFFERS. The local _linked_below shim is replaced by integration.skill_layout.linked_below. Refs #5838 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
Measured; closing (scratch). |
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.
Measure-only scratch for #5849 step B. Composed tree: train-5 tip d7b9a2f + #5843a3c1bbd + #5849dc9d462 (fix), with
_MEASURE = Trueso the plugin journeys print every counter. Closed after the Lifecycle Smoke run reports. Do not merge. Refs #5838