Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
05fbdbd
fix(pypi): use native indexes for resolution and install
lejunyang Nov 22, 2026
37feafc
fix(go): honor native module source policy
lejunyang Nov 22, 2026
a2c07a0
fix(go): keep activation mirrors out of native source policy
lejunyang Nov 22, 2026
03a08f3
fix(go): preserve GOPROXY overrides after activation
lejunyang Nov 22, 2026
b0eb4ca
fix(pypi): check merged uv indexes before resolving tools
lejunyang Nov 22, 2026
93d742a
fix(go): keep parent module lookup inside private scope
lejunyang Nov 22, 2026
d610949
fix(go): validate locked policy before online install reuse
lejunyang Nov 22, 2026
240cf22
test(go): exercise private module lookup with loopback proxies
lejunyang Nov 22, 2026
c0b9ab1
fix(go): replay module locks across local source policies
lejunyang Nov 23, 2026
9337621
fix(pypi): ignore credentials without an index declaration
lejunyang Nov 23, 2026
6273c7e
fix(go): scope privacy-only policies to matching modules
lejunyang Nov 23, 2026
b8ea3c7
fix(go): identify managed proxy chains in every export
lejunyang Nov 23, 2026
c23f02d
fix(pypi): isolate global uv indexes and retain default fallback
lejunyang Nov 23, 2026
bb04b13
fix(pypi): ignore unrelated uv modes during source discovery
lejunyang Nov 23, 2026
8714206
fix(sources): honor Go and Python package precedence
lejunyang Nov 23, 2026
2e5243f
fix(sources): handle empty pip overrides and unreadable GOENV
lejunyang Nov 23, 2026
0799305
docs(sources): clarify native configuration boundary behavior
lejunyang Nov 23, 2026
653ca02
修正原生配置边界行为并完成全量验证
lejunyang Nov 23, 2026
54528c1
fix(pypi): isolate managed installs from native extra indexes
lejunyang Nov 23, 2026
3cb1ca8
fix(pypi): refuse pip fallback for uv first-index sets
lejunyang Nov 23, 2026
31bfac8
fix(go): preserve managed proxy origin at first hook capture
lejunyang Nov 23, 2026
d215cda
fix(pypi): merge named uv index overrides before filtering
lejunyang Nov 23, 2026
3a8ce80
交办第 3 轮:修改项 T9、T10(第 3 轮没提交的改动)
lejunyang Nov 23, 2026
299af7e
test(go): execute proxy capture in fish and PowerShell 7
lejunyang Nov 24, 2026
6f43f8d
ci(pypi): register real native index installation checks
lejunyang Nov 24, 2026
d8e142a
test(go): cover CLI proxy lifecycle in native shell smoke
lejunyang Nov 24, 2026
682f805
交办第 4 轮:修改项 T13、T14、T15(第 4 轮没提交的改动)
lejunyang Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ jobs:
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: install Fish for execution regressions
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y fish
- name: clippy
run: cargo clippy --workspace --all-targets
- name: test
Expand All @@ -165,6 +168,13 @@ jobs:
# Only the generic github: backend needs this. Current tests use local
# fixture servers and do not require network access.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Linux PowerShell Go env/exec and hook restoration
if: runner.os == 'Linux'
shell: pwsh
run: |
cargo build --locked -p osdk-cli
if ($LASTEXITCODE -ne 0) { throw 'Linux CLI build failed' }
./scripts/test-go-proxy-powershell.ps1 -Osdk ./target/debug/osdk
- name: build windows runtime binaries
if: runner.os == 'Windows'
shell: pwsh
Expand All @@ -188,6 +198,47 @@ jobs:
CARGO_TARGET_DIR: ${{ runner.temp }}\osdk-ci-target
run: ./scripts/windows-runtime-smoke.ps1 -BinDir "$env:CARGO_TARGET_DIR\debug"

pypi-native-install:
name: real pip/uv native source installs
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.98.0
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: install real uv oracle
run: python -m pip install uv==0.13.1
- name: build task runner
run: cargo build --locked -p osdk-cli
- name: run registered loopback installation task
shell: bash
run: |
set -euo pipefail
test -x "$(command -v openssl)"
python_path="$(command -v python)"
uv_path="$(command -v uv)"
export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}"
export HOME="$RUNNER_TEMP/pypi-native-home"
export OSDK_DATA_DIR="$RUNNER_TEMP/pypi-native-data"
export OSDK_CACHE_DIR="$RUNNER_TEMP/pypi-native-cache"
export OSDK_CONFIG_DIR="$RUNNER_TEMP/pypi-native-config"
export OSDK_STORE_DIR="$RUNNER_TEMP/pypi-native-store"
export OSDK_INSTALL_DIR="$RUNNER_TEMP/pypi-native-installs"
export OSDK_TRUSTED_CONFIG_PATHS="$GITHUB_WORKSPACE"
mkdir -p "$HOME"
./target/debug/osdk run pypi-native-install -- \
--python "$python_path" --uv "$uv_path" \
--report "$RUNNER_TEMP/pypi-native-install.json"
- uses: actions/upload-artifact@v4
if: always()
with:
name: pypi-native-install
path: ${{ runner.temp }}/pypi-native-install.json

# Explicit Windows cross-checks from Linux. Clippy guards every cfg path,
# while Wine executes the Windows GNU test binaries against Win32 APIs even
# before the native Windows/MSVC runner finishes.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ schema-4 lock records the proxy, module root, and exact Go runtime—not the
transitive module graph—so an exact completed install can be reused offline,
but a cold offline build cannot.

Online `osdk install` checks that the current Go proxy and privacy settings match
the lock even when the tool is already installed.

Go tool installs honor `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` (including lowercase forms).

Guide: [Go developer tools](site/en/guide/tools/go.md)
Expand Down Expand Up @@ -931,7 +934,7 @@ checksum/attestation verification fails, an archive cannot be unpacked, or its r
missing. The receipt records the source whose artifact actually passed. Model sync likewise falls
through after one source exhausts its attempts; exhaustion of every source remains terminal.

Delegated ecosystems fail over only before or inside the native resolver: Cargo verifies the exact crate download endpoint before selecting a sparse index, `pypi:` probes the requested project and passes that choice to uv/pip, and fresh `go:` installs receive a `|`-joined GOPROXY chain. Project package-manager commands are still executed once, because blindly replaying a command after lifecycle scripts may duplicate side effects.
If pip or uv is configured with a single index, `pypi:` uses it for version lookup and installation. Global tools ignore project uv configuration; additional native uv indexes retain default PyPI and require uv so first-index selection is preserved. Without a native index, set `[registries.python].urls` to choose the mirrors osdk can use. Set `[settings.precedence] python = "osdk"` to use that selected index for both lookup and installation, ignoring native additional indexes. `go:` uses your native Go module proxy and privacy settings, including values saved by `go env -w`. Version lookup for a private command stays within its Go no-proxy scope when checking parent module paths. Managed `go` commands also keep these settings, including command-level `GOPROXY` overrides after activation. Go locks keep the module and exact version, so teammates and CI can replay them with different local proxy settings.

A mirror already set in your environment (`RUSTUP_DIST_SERVER`, `GOPROXY`,
`npm_config_registry`, and the like) is validated and then raced against osdk's
Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ gopls version
root 与精确 Go runtime,不记录传递 module graph;因此可离线复用精确匹配的完整安装,
但不能进行全新离线构建。

在线运行 `osdk install` 时,即使 Go 工具已经安装,也会核对当前代理及私有模块设置是否与锁文件一致。

Go 工具安装保留 `HTTP_PROXY`、`HTTPS_PROXY` 和 `NO_PROXY`(含小写形式)。

指南:[Go 开发工具](site/guide/tools/go.md)
Expand Down Expand Up @@ -819,7 +821,7 @@ Last-Modified,通过 `Range` + `If-Range` 断点续传;服务端忽略或返
存在后才会被选中;任一步失败都会继续下一个排序来源,receipt 记录真正通过验证的来源。
模型在某个来源耗尽尝试后同样会继续下一个排序来源;所有来源都耗尽后才终止。

委托型生态只在原生解析器执行前或内部回退:Cargo 选定 sparse index 前检查精确 crate 下载端点,`pypi:` 探测实际项目并把结果传给 uv/pip,全新 `go:` 安装则收到以 `|` 连接的 GOPROXY 链。项目包管理器命令仍只执行一次,因为 lifecycle script 运行后盲目重放可能产生重复副作用。
pip 或 uv 已配置单一索引时,`pypi:` 用它查版本和安装。全局工具忽略项目 uv 配置;uv 追加索引保留默认 PyPI,并要求 uv 保持 first-index 选择语义。没有配置原生索引时,可以通过 `[registries.python].urls` 指定 osdk 可用的镜像。设置 `[settings.precedence] python = "osdk"` 后,查询和安装统一使用选中的 osdk 索引,忽略原生追加索引。`go:` 安装和受管 `go` 命令会保留 Go 原生模块代理与私有模块设置,包括用 `go env -w` 保存的值和激活后为单条命令指定的 `GOPROXY`。查私有工具版本时,只在 Go 的免代理范围内尝试父模块路径。Go 锁保留模块与精确版本,团队成员和 CI 可使用不同的本机代理设置回放。

环境变量里已经设置的镜像(`RUSTUP_DIST_SERVER`、`GOPROXY`、`npm_config_registry`
等)会先经过校验,再与 osdk 内置镜像一起参与测速竞争,因此过期或不可用的值不会
Expand Down
1 change: 1 addition & 0 deletions crates/osdk-cli/src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,7 @@ async fn install_one_with_resolution(
VersionSpec::Exact(_) | VersionSpec::Pinned(_)
))
{
backend.validate_install_reuse(&app.ctx, &effective)?;
if let Some(installed) = installed_dynamic_match(app, backend.as_ref(), &effective) {
backend.ensure_post_install(&app.ctx, &installed)?;
println!("{}", t!("msg.already_installed", tool = installed));
Expand Down
2 changes: 1 addition & 1 deletion crates/osdk-cli/src/lockfile/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ pub(crate) fn validate_go_native_replay(
let source = native.source.as_deref().ok_or_else(|| {
anyhow::anyhow!("schema 4 Go entry `{backend}` is missing its proxy source")
})?;
osdk_core::backend::go_package::validate_go_proxy(source)?;
osdk_core::backend::go_package::validate_go_source_identity(source)?;
let module = native.module.as_deref().ok_or_else(|| {
anyhow::anyhow!("schema 4 Go entry `{backend}` is missing its module root")
})?;
Expand Down
2 changes: 1 addition & 1 deletion crates/osdk-cli/src/lockfile/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ pub(crate) fn locked_native_metadata(version: &ToolVersion) -> Result<Option<Loc
version.backend
)
})?;
osdk_core::backend::go_package::validate_go_proxy(source)?;
osdk_core::backend::go_package::validate_go_source_identity(source)?;
if metadata.module.is_none() {
anyhow::bail!(
"Go tool `{}` is missing its locked module root",
Expand Down
Loading
Loading