You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(install): a plain install's attestation serves the first install --frozen (#4770) - #5423
↑ Rebased on main f68cebd. #5447, #5442 and #5452 kept; the PR diff vs main is additive. ↑ S93 input-mutation oracle: 0 survivors in replay, attested and attested-frozen modes; both positive controls flagged on 8225ec6. ↑ CI green at this head (46 pass); Copilot reviewed it with 0 open threads. ↓ The W3d delta walk at this head was pending when assessed.
Performance gain
8/10
↑ Linux t10 frozen no-op CPU p50 0.970 s (base 1.142), paired wall 0.895; t50 paired 0.768. ↑ Windows paired 0.789 (t10) and 0.665 (t50). Output "same" in every cell. ↓ Linux t10 wall is 1.058 s; main's no-op fixed cost rose since the 0.857 s pre-rebase run. ↓ Windows t10 is 1.43 s. CI runs never hit by design.
Description
The first apm install --frozen after apm install (a developer's install-then-frozen path; CI runs never record or hit by design, verdict_record._NO_HIT_ENV) never took the attested fast path, because the attestation key holds argv. It paid the full proof: Linux tree-10 p50 0.93-1.16 s, tree-50 2.05 s (runs 45547721768, 45547807435, at 4287880), against the #4770 bar of <= 1 s.
This lets a plain install's attestation serve the first install --frozen, under W3d's argv-class ruling (AF1-AF5):
AF1, keying. An attested record keys its argv and the run's effective frozen disposition, which its single reader (InstallService.frozen_disposition) notes. Both are bound by the record's MAC. The class is one-way: a frozen run accepts a plain or frozen attestation, and a plain run accepts only a plain one. Output records (replay) stay argv-exact.
AF2/AF3, frozen refusals. On a frozen hit, the frozen preflight owner (InstallService.enforce_frozen) and the lock-only edge walk (_refuse_unproven_edges) run live before any other attested gate. That's after the claude, policy and target refusals, and decide_only skips none of them. verdict_attest.FROZEN_OWNERS classifies every frozen-only owner (the frozen owner row's modules and every frozen method of InstallService) as live or implied, with a reason. A closed-world test fails on any new unclassified owner.
AF4, parity. The fast render runs the frozen preflight at the full run's point, so --frozen prints what the full frozen pipeline prints. The direct-MCP trust notice was missing on the frozen fast path before this; that gap pre-dated this PR and is fixed here.
AF5. A frozen hit records nothing, so the plain attestation keeps serving later --frozen runs.
Consent (Copilot). The fast path's frozen preflight is speculative (InstallRequest.frozen_preflight(speculative=True), a preview). It reads a legacy approvals.yml and never migrates it; the full install owns that write.
Parity (only-apm cell). A fast render that falls back now forgets the once-per-command trust notices it printed into dropped output, so the full run prints them. The frozen preflight runs in try_apply before planning for every frozen fast run.
Equivalence
A converged plain install committed lock L from manifest M. With byte-identical M, L, governed trees, approvals, config, policy cache and build, and every deployed file and package copy re-hashed no-follow (A7), install --frozen replays L. Its verdict differs from the plain verdict only by the frozen refusals. Those are re-judged live (enforce_frozen, edges, services) or fixed by the keyed inputs, as FROZEN_OWNERS records for each owner.
Human scope-approval comment: the #4770 install-performance scope (review contact Daniel Meppiel (@danielmeppiel)); argv-class change ordered by the PERF VP (2026-11-25 05:44 CET) and ruled by W3d (row w3d:ruling:argv-class, AF1-AF5).
Does this PR complete the issue, or what remains? #4770 closes once this and #5383 are on main and the frozen bar reads <= 1 s on both benches.
tests/integration/test_verdict_record.py: a plain attestation serves the first frozen; a frozen attestation never serves plain; a forged argv or disposition never serves; a changed manifest, lock, deployed byte or package copy misses for frozen (each with a positive control); every frozen-only owner is classified (closed world).
tests/integration/test_verdict_record.py also: a CI-implied frozen run accepts only a plain record; a frozen hit re-proves every declared edge from the lock.
the first and second --frozen after install are attested hits that record nothing;
for converged (with a declared MCP server), manifest drift, lock-only edge, local dependency and after --only apm, --frozen prints, exits and leaves the lock exactly as the full frozen pipeline (APM_INSTALL_FAST_PATH=0) does;
the speculative preflight never migrates legacy consent;
an apm.yml MCP server the lock lacks is refused by the preflight before any fast decision.
Benches at 7a88c66 vs main f68cebd, RTT 30 ms, 3 runners x 5 pairs, output "same" in every cell:
install-noop is unchanged on both OSes (paired 0.99-1.01). The Linux tree-10 CPU p50 meets #4770's <= 1 s bar. The Windows attested hit's fixed cost (~1.4 s at t10) is tracked as a follow-up.
S93 input-mutation oracle: 0 survivors at this head in replay, attested and attested-frozen modes on tree-10, tree-10-mcp and tree-10-claude-routed. The #5438 and #5434 positive controls are flagged on 8225ec6. Details: #5423 (comment).
Changelog
One fragment per section, changelog.d/5423.changed.md.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A failed frozen preflight can suppress trust notices the user never saw, and valid-attestation regressions are missing for locked-edge and frozen-preflight refusals.
This PR extends the install attestation fast path so an unchanged apm install --frozen can reuse a prior plain install’s attestation. Existing CI environment exclusions still apply.
Changes:
Bind argv and effective frozen disposition to attestations, allowing one-way reuse by frozen installs.
Re-run frozen checks and render preflight notices without replacing the original attestation.
Add integrity, compatibility, and full-pipeline parity coverage.
File
Description
tests/integration/test_verdict_record.py
Tests attestation reuse, tampering rejection, and frozen-owner classification.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The speculative preflight can delete legacy approval files and persist personal-consent grants before journaling begins, leaving changes that a later decline cannot roll back.
This test can pass even if both frozen runs fall back to the full pipeline: attested hit is emitted before the gates, and a fallback can rewrite the attestation without emitting recorded. Assert the terminal fast-path decision and unchanged attestation bytes and modification times after each frozen run to protect both the performance behavior and the no-write guarantee.
…; pin both frozen gates
Copilot #5423 round 1:
- enforce_frozen's MCP admission migrated a legacy approvals.yml into
config.json; the fast path's preflight runs before its journal (and under
decide), so that write could not roll back. A speculative request
(InstallRequest.frozen_preflight(speculative=True), a preview) reads legacy
consent and never migrates it; the full install keeps the migration.
Cell red on 5b83654.
- Cells that fail when either frozen gate is removed (mutation-checked): the
attested gates decline a frozen hit whose declared edge the lock lacks
(positive control: plain, and a satisfiable edge); an MCP server apm.yml
declares but the lock lacks is refused by the preflight before any fast
decision (decide mode stops before the render).
- The release note is scoped to non-CI runs: CI / GITHUB_ACTIONS never record
or hit (verdict_record._NO_HIT_ENV).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The attested path bypasses the verifier, so its owner classification incorrectly marks it as live rather than implied by the marketplace-edge decline in _refuse_unproven_edges.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Attested hits incorrectly classify the verifier as live
src/apm_cli/install/verdict_attest.py:146
This verifier is not called by enforce_frozen: its only call is in InstallService.run at service.py:336, which the attested path bypasses. The owner classification therefore incorrectly labels it as live on a hit. Classify it as implied by the marketplace-edge decline in _refuse_unproven_edges.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Two critical issues remain: full frozen installs fail on an unsupported install_mcp keyword, and the missing frozen_mcp_drift owner classification causes the new coverage test to fail.
… --frozen (#4770)
The first apm install --frozen after apm install never took the attested
fast path (the key held argv), so CI's install-then-frozen path paid the full
proof (t10 0.93-1.16 s, t50 2.05 s). W3d ruling (argv-class, AF1-AF5):
- AF1: an attested record keys its argv and the run's effective frozen
disposition (noted by InstallService.frozen_disposition, its single reader),
MAC-bound. One-way: a frozen run accepts a plain or frozen attestation; a
plain run only a plain one. Output replay stays argv-exact.
- AF2/AF3: on a frozen hit the frozen preflight owner (enforce_frozen) and the
lock-only edge walk run live before any other gate; FROZEN_OWNERS classifies
every frozen-only owner live or implied, closed by a test.
- AF4: the fast render runs the frozen preflight at the full run's point, so
--frozen prints what the full frozen pipeline prints (the direct-MCP trust
notice was missing on the frozen fast path; pre-existing, fixed here).
- AF5: a frozen hit records nothing, so the plain attestation keeps serving.
Red-first on ddd81de: plain attestation -> frozen hit, the changed-input
controls and the closed-world cell fail; the converged frozen differential
fails on the missing trust notice.
apm-spec-waiver: install fast-path keying is local verdict state, outside the OpenAPM spec
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
… before any fast decision
W3d R1: the full install and the fast path's frozen hit build the preflight
request through one builder (InstallRequest.frozen_preflight), with
allow_pending_mcp explicit at each call.
W3d R2 cells: a converged frozen hit answers with its declared MCP gate live;
after install --only apm (argv-exact, never served) --frozen is no hit and
answers as the full pipeline; a CI-implied frozen run with argv [install]
accepts a plain record and never a [install, --frozen]-keyed one.
The 'only apm' differential exposed a parity bug: when a fast render fails
and falls back, a once-per-command trust notice it printed into the dropped
output was never shown by the full run. held_output now forgets notices shown
into output it drops (mcp_config_view owns the set). The frozen preflight
owner now runs in try_apply before planning for every frozen fast run, so a
frozen refusal declines before any decision.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…; pin both frozen gates
Copilot #5423 round 1:
- enforce_frozen's MCP admission migrated a legacy approvals.yml into
config.json; the fast path's preflight runs before its journal (and under
decide), so that write could not roll back. A speculative request
(InstallRequest.frozen_preflight(speculative=True), a preview) reads legacy
consent and never migrates it; the full install keeps the migration.
Cell red on 5b83654.
- Cells that fail when either frozen gate is removed (mutation-checked): the
attested gates decline a frozen hit whose declared edge the lock lacks
(positive control: plain, and a satisfiable edge); an MCP server apm.yml
declares but the lock lacks is refused by the preflight before any fast
decision (decide mode stops before the render).
- The release note is scoped to non-CI runs: CI / GITHUB_ACTIONS never record
or hit (verdict_record._NO_HIT_ENV).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…install_mcp; classify frozen_mcp_drift
main added install_mcp to the full install's frozen preflight request (skills-only
MCP omissions) and moved the frozen MCP drift reasons into frozen_mcp_drift. The
one builder (InstallRequest.frozen_preflight) now carries install_mcp, and the
closed-world FROZEN_OWNERS classifies frozen_mcp_drift as live (it runs inside
enforce_frozen).
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The lockfile assertion compares two current reads rather than a pre-gate snapshot, so it cannot detect gate-induced writes and leaves the frozen no-write invariant unchecked.
S93 input-mutation oracle (CI, research harness perf-research/oracle-v5)
The oracle traces every file, directory, absent-path probe and environment variable that a full (fast path off) install reads. It then mutates each one in a converged world and runs the fast path. A fast answer on a mutated input counts as a finding when the full pipeline, run on the same mutated state, exits differently, prints different output or writes anything. Modes: replay (output record, install), attested (fresh attested record, install), attested-frozen (a plain attestation, then install --frozen, the path this PR opens). New fixture: tree-10-claude-routed, a Claude target whose packages ship an always-on instruction, so the carrier logic in #5434 is in play.
Positive controls, on 8225ec6 (before #5447 and #5442): both FLAGGED.
Every attested-frozen hit printed, exited and wrote exactly what the full frozen pipeline did. The hits were a new root AGENTS.md or CLAUDE.md (no Claude target, or the Claude refusal declined after the record matched) and one test-only environment hook.
Control, main f68cebd (run 45625193194, run 45625620508): 0 findings. On main, --frozen is never served (attested miss (inputs changed: argv)), so the frozen cells above cover only the surface this PR adds.
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
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
7a88c66ad48d6b2e696ee50b0fb436c8f3141422↑ S93 input-mutation oracle: 0 survivors in replay, attested and attested-frozen modes; both positive controls flagged on 8225ec6.
↑ CI green at this head (46 pass); Copilot reviewed it with 0 open threads.
↓ The W3d delta walk at this head was pending when assessed.
↑ Windows paired 0.789 (t10) and 0.665 (t50). Output "same" in every cell.
↓ Linux t10 wall is 1.058 s; main's no-op fixed cost rose since the 0.857 s pre-rebase run.
↓ Windows t10 is 1.43 s. CI runs never hit by design.
Description
The first
apm install --frozenafterapm install(a developer's install-then-frozen path; CI runs never record or hit by design,verdict_record._NO_HIT_ENV) never took the attested fast path, because the attestation key holds argv. It paid the full proof: Linux tree-10 p50 0.93-1.16 s, tree-50 2.05 s (runs 45547721768, 45547807435, at 4287880), against the #4770 bar of <= 1 s.This lets a plain install's attestation serve the first
install --frozen, under W3d's argv-class ruling (AF1-AF5):InstallService.frozen_disposition) notes. Both are bound by the record's MAC. The class is one-way: a frozen run accepts a plain or frozen attestation, and a plain run accepts only a plain one. Output records (replay) stay argv-exact.InstallService.enforce_frozen) and the lock-only edge walk (_refuse_unproven_edges) run live before any other attested gate. That's after the claude, policy and target refusals, anddecide_onlyskips none of them.verdict_attest.FROZEN_OWNERSclassifies every frozen-only owner (the frozen owner row's modules and every frozen method ofInstallService) as live or implied, with a reason. A closed-world test fails on any new unclassified owner.--frozenprints what the full frozen pipeline prints. The direct-MCP trust notice was missing on the frozen fast path before this; that gap pre-dated this PR and is fixed here.--frozenruns.InstallRequest.frozen_preflight(speculative=True), a preview). It reads a legacyapprovals.ymland never migrates it; the full install owns that write.try_applybefore planning for every frozen fast run.Equivalence
A converged plain install committed lock L from manifest M. With byte-identical M, L, governed trees, approvals, config, policy cache and build, and every deployed file and package copy re-hashed no-follow (A7),
install --frozenreplays L. Its verdict differs from the plain verdict only by the frozen refusals. Those are re-judged live (enforce_frozen, edges, services) or fixed by the keyed inputs, asFROZEN_OWNERSrecords for each owner.Issue and approved scope
Issue: Refs #4770
Human scope-approval comment: the #4770 install-performance scope (review contact Daniel Meppiel (@danielmeppiel)); argv-class change ordered by the PERF VP (2026-11-25 05:44 CET) and ruled by W3d (row w3d:ruling:argv-class, AF1-AF5).
Does this PR complete the issue, or what remains? #4770 closes once this and #5383 are on main and the frozen bar reads <= 1 s on both benches.
Type of change
Testing
Cells:
tests/integration/test_verdict_record.py: a plain attestation serves the first frozen; a frozen attestation never serves plain; a forged argv or disposition never serves; a changed manifest, lock, deployed byte or package copy misses for frozen (each with a positive control); every frozen-only owner is classified (closed world).tests/integration/test_verdict_record.pyalso: a CI-implied frozen run accepts only a plain record; a frozen hit re-proves every declared edge from the lock.tests/integration/test_verdict_record_attested_world.py(real CLI):--frozenafterinstallare attested hits that record nothing;--only apm,--frozenprints, exits and leaves the lock exactly as the full frozen pipeline (APM_INSTALL_FAST_PATH=0) does;Benches at 7a88c66 vs main f68cebd, RTT 30 ms, 3 runners x 5 pairs, output "same" in every cell:
install-noopis unchanged on both OSes (paired 0.99-1.01). The Linux tree-10 CPU p50 meets #4770's <= 1 s bar. The Windows attested hit's fixed cost (~1.4 s at t10) is tracked as a follow-up.S93 input-mutation oracle: 0 survivors at this head in replay, attested and attested-frozen modes on tree-10, tree-10-mcp and tree-10-claude-routed. The #5438 and #5434 positive controls are flagged on 8225ec6. Details: #5423 (comment).
Changelog
changelog.d/5423.changed.md.Spec conformance (OpenAPM v0.1)