Repository navigation
fix(install): a linked governed directory never proves a no-op - #5442
Merged
Daniel Meppiel (danielmeppiel) merged 7 commits intoNov 25, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 7 commits into
Daniel Meppiel (danielmeppiel) merged 7 commits into
Conversation
The verified-state replay and the attested hit keyed a governed target root by os.path.isdir and walked through it, so a root (or subdirectory) swapped for a symlink or junction to an identical copy still hit, while the engine's fast path refuses any link in a deployed path. verdict_inputs._kind now treats a junction as a link; walk_governed refuses any linked governed level (no record, a miss) and _deployed_intact refuses a linked parent of a deployed file. One lstat per governed directory level. Fixes #5438 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 25, 2026 07:12
Refs #5438 apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refs #5438 apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Directory symlinks can still be recorded and reused when they should force a miss, and the new regression tests lack the marker needed to run in the Windows gate.
3 open issues
What changed in this PR
This PR addresses #5438 by tightening install no-op verification so linked governed directories cannot be treated as verified state, aligning replay and attested-hit checks with the engine’s path-safety rules.
Changes:
- Adds junction-aware path classification and governed-directory checks.
- Checks deployed-file parent directories before accepting cached state.
- Adds regression tests and a user-facing changelog entry.
| File | Description |
|---|---|
tests/integration/test_verdict_record.py |
Adds linked-directory regression tests for replay, attestation, recording, and engine refusal. |
src/apm_cli/install/verdict_record.py |
Keys target roots by kind and checks deployed-file parents. |
src/apm_cli/install/verdict_inputs.py |
Adds junction detection, governed traversal checks, and cached parent checks. |
changelog.d/5442.fixed.md |
Documents the install no-op verification fix. |
Review effort: Balanced
…wner (#5438) Route the verdict's link predicate and deployed-parent check through path_security (is_link_stat, has_symlink_component), the owner diff_apply._within uses, and guard the routing statically. Refuse a governed link that is not a link to a regular file (POSIX lists a directory link among the files). Mark the new cells windows_compat. apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive no-op verification changes require final-revision Windows CI evidence because junction classification depends on Windows lstat/scandir behavior, and the supplied red-first RC run does not validate the fix.
No open issues 🎉
3 resolved since last review
Review effort: Balanced
… module Keeps transport_auth_platform.py under the 2100-line cap; same rule id (transport-platform-url-path-security), same checks, same MutationCase. apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…d-root refusal apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-fix-5438-linked-target-roots
branch
November 25, 2026 08:40
5 of 10 tasks
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
The verified-state no-op checks shipped in train #5406 (the record replay and the attested hit, #5383) keyed governed target directories by content only. They did not key each directory level by its filesystem kind, which the engine's full fast path does check. This PR makes both checks use the same kind rule as the engine.
verdict_inputs._kind, the one lstat owner of these inputs, now classifies Windows name-surrogate reparse points the waypath_security._is_linkdoes.verdict_inputs.walk_governedwalks a governed root and keys every level by kind. A level the engine would refuse raisesValueError, which means no record and a miss.target:<dir>is keyed by kind._deployed_intactapplies the same kind rule to each deployed file's parent chain below the project root.Cost: one lstat per governed directory level per no-op check. Parents already seen are not checked again.
Issue and approved scope
Issue: Fixes #5438
Human scope-approval comment: v0.39.0 red-team finding, filed into QL v2's red-team ledger (E2-1); the CEO order is that every bug found in the red team is fixed.
This completes the issue.
Type of change
Testing
Red before the fix: red-first cells on the RC (4287880) failed for the replay and the attested hit, and passed the engine control [CI run 45565008442].
New cells in
tests/integration/test_verdict_record.py: directory-kind changes miss the replay and the attested hit (with a positive control), are never recorded, and match the engine's own refusal. Windows coverage uses a junction.Local runs are paused on the host per the CEO load order; this PR's CI is the validation.
Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
apm-spec-waiver: no-op fast-path input keying fix; install outcomes are unchanged