-
Notifications
You must be signed in to change notification settings - Fork 0
test(supply-chain): preserve simple dependency-path cycle semantics #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
28
commits into
develop
Choose a base branch
from
bolt-optimize-supply-chain-check-10739114227262951755
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5b71eb0
perf: optimize supply chain check graph traversal memory usage
seonghobae 3f94b21
test(supply-chain): preserve simple dependency path semantics
seonghobae 28c61cd
fix(supply-chain): preserve simple path cycle semantics
seonghobae 913e7c7
perf: optimize supply chain check graph traversal memory usage
seonghobae fca0bb7
⚡ Bolt: [성능 개선] 의존성 그래프 탐색 메모리 최적화
seonghobae b6690c6
test(supply-chain): reproduce cyclic owner-chain false positive
seonghobae bbf46a3
fix(supply-chain): restore simple dependency-path semantics
seonghobae 3ac96dd
docs(supply-chain): preserve simple-path authority
seonghobae a88b213
⚡ Bolt: [성능 개선] 의존성 그래프 탐색 메모리 최적화
seonghobae f4a6053
fix(supply-chain): restore simple dependency-path cycle semantics
cursoragent 4881dba
revert(supply-chain): restore validated simple-path semantics after d…
seonghobae dbcbe6d
merge(supply-chain): consolidate cycle regression authority into #867
seonghobae bcf22ee
⚡ Bolt: [성능 개선] 의존성 그래프 탐색 메모리 최적화 내 사이클 버그 수정
seonghobae f270d3d
fix(supply-chain): restore simple-path cycle regressions after Bolt r…
cursoragent 593b6fe
fix(supply-chain): restore simple-path authority and lock policy text
cursoragent 09a27eb
test(supply-chain): lock simple-path policy authority
seonghobae 7ac91ff
test(supply-chain): lock direct path through cyclic graph
seonghobae 250b29f
fix(security): resolve pdfjs-dist CVE-2026-16633
seonghobae 5903ee7
fix(supply-chain): restore canonical dependency-path guard
seonghobae 07583f3
test(supply-chain): lock direct path through cyclic graph
seonghobae 71055cc
🛡️ Sentinel: [HIGH] Ignore pdfjs-dist CVE-2026-16633
seonghobae ad25533
fix(supply-chain): drop inherited pdfjs Trivy suppression
seonghobae f19be09
fix(supply-chain): keep dependency remediation in #783
seonghobae e2c590e
test(supply-chain): reject recursion-limited traversal
seonghobae eaba529
test(supply-chain): format depth regression
seonghobae 4d69ad1
fix(supply-chain): keep dependency path traversal iterative
seonghobae c02c752
test(supply-chain): restore simple-path cycle authority
seonghobae f1ac416
docs(security): restore simple-path dependency authority
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
64 changes: 64 additions & 0 deletions
64
services/analysis-engine/tests/test_supply_chain_dependency_path_cycles.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| """Regression tests for Cargo dependency-path cycle handling.""" | ||
|
|
||
| from conftest import load_module | ||
|
|
||
|
|
||
| def test_dependency_path_does_not_reuse_a_package_key_through_a_cycle() -> None: | ||
| """Ensure a cycle cannot make one package instance satisfy two path positions.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_cycle_regression", | ||
| ) | ||
| package_dependencies = { | ||
| "root 1.0.0": ["alpha 1.0.0"], | ||
| "alpha 1.0.0": ["beta 1.0.0", "charlie 1.0.0"], | ||
| "beta 1.0.0": ["alpha 1.0.0"], | ||
| "charlie 1.0.0": [], | ||
| } | ||
|
|
||
| assert not supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) | ||
|
|
||
|
|
||
| def test_dependency_path_still_matches_direct_path_on_cyclic_graph() -> None: | ||
| """Cycle prevention must not reject a valid simple path that avoids reuse.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_cycle_direct_regression", | ||
| ) | ||
| package_dependencies = { | ||
| "root 1.0.0": ["alpha 1.0.0"], | ||
| "alpha 1.0.0": ["beta 1.0.0", "charlie 1.0.0"], | ||
| "beta 1.0.0": ["alpha 1.0.0"], | ||
| "charlie 1.0.0": [], | ||
| } | ||
|
|
||
| assert supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "charlie"), | ||
| ) | ||
|
|
||
|
|
||
| def test_dependency_path_can_match_same_name_on_distinct_package_keys() -> None: | ||
| """Ensure distinct package instances may legitimately satisfy repeated names.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_distinct_instances", | ||
| ) | ||
| package_dependencies = { | ||
| "root 1.0.0": ["alpha 1.0.0"], | ||
| "alpha 1.0.0": ["beta 1.0.0"], | ||
| "beta 1.0.0": ["alpha 2.0.0"], | ||
| "alpha 2.0.0": ["charlie 1.0.0"], | ||
| "charlie 1.0.0": [], | ||
| } | ||
|
|
||
| assert supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) |
29 changes: 29 additions & 0 deletions
29
services/analysis-engine/tests/test_supply_chain_dependency_path_depth.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """Depth-safety regressions for Cargo dependency owner-chain traversal.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sys | ||
|
|
||
| from conftest import load_module | ||
|
|
||
|
|
||
| def test_dependency_path_handles_graph_deeper_than_python_recursion_limit() -> None: | ||
| """A valid long Cargo graph must not fail because Python recursion is bounded.""" | ||
| supply_chain = load_module( | ||
| "scripts/checks/verify_supply_chain.py", | ||
| "verify_supply_chain_dependency_path_depth", | ||
| ) | ||
| edge_count = sys.getrecursionlimit() + 50 | ||
| package_dependencies = { | ||
| f"node-{index} 1.0.0": [f"node-{index + 1} 1.0.0"] for index in range(edge_count) | ||
| } | ||
| package_dependencies[f"node-{edge_count} 1.0.0"] = [] | ||
|
|
||
| assert ( | ||
| supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "node-0 1.0.0", | ||
| ("missing-owner",), | ||
| ) | ||
| is False | ||
| ) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.