From 26f5ca2fbea58ae96417b327945974602a39c239 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 05:17:47 +0000 Subject: [PATCH 1/3] chore: start issue 426 fix --- template/pre-commit.ps1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/template/pre-commit.ps1 b/template/pre-commit.ps1 index 9c21fb597..32cd5a214 100644 --- a/template/pre-commit.ps1 +++ b/template/pre-commit.ps1 @@ -1,12 +1,12 @@ - -#!/bin/sh - - -# Pre-commit hook example -# Exit with 0 to allow commit, non-zero to reject - -# Example -# Write-Host "Running pre-commit hook" - - -exit 0 + +#!/bin/sh + + +# Pre-commit hook example +# Exit with 0 to allow commit, non-zero to reject + +# Example +# Write-Host "Running pre-commit hook" + + +exit 0 From 453998d4a3d97f6d79c9d4e8677ee050db4e6eee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 05:18:03 +0000 Subject: [PATCH 2/3] fix: use https installer examples --- Cargo.toml | 4 +++ install.sh | 8 ++--- tests/compat/README.md | 1 + .../compat/installer_https_examples_guard.rs | 33 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/compat/installer_https_examples_guard.rs diff --git a/Cargo.toml b/Cargo.toml index 5aaf86ae5..4a9138934 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -277,6 +277,10 @@ path = "tests/compat/help_no_impl_meta_leak.rs" name = "compat_format_patch_flag_surface" path = "tests/compat/format_patch_flag_surface.rs" +[[test]] +name = "compat_installer_https_examples_guard" +path = "tests/compat/installer_https_examples_guard.rs" + [[test]] name = "compat_otlp_feature_gate_guard" path = "tests/compat/otlp_feature_gate_guard.rs" diff --git a/install.sh b/install.sh index f47033cae..955fed5d6 100644 --- a/install.sh +++ b/install.sh @@ -178,12 +178,12 @@ error_exit() { # shellcheck disable=SC2016 # $HOME is shown to the user verbatim printf ' %s▸%s pick a writable directory %sexport LIBRA_HOME="$HOME/.libra"%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" - printf ' %s▸%s pin a known-good version %scurl -fsSL libra.tools/install.sh | sh -s -- -v v0.1.0%s\n' \ + printf ' %s▸%s pin a known-good version %scurl -fsSL https://libra.tools/install.sh | sh -s -- -v v0.1.0%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" printf ' %s▸%s open a bug report %sgithub.com/libra-tools/libra/issues%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" printf '\n %sneed the full log? re-run with:%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL libra.tools/install.sh | sh 2>&1 | tee install.log%s\n\n' "$C_TEXT" "$C_RESET" + printf ' %scurl -fsSL https://libra.tools/install.sh | sh 2>&1 | tee install.log%s\n\n' "$C_TEXT" "$C_RESET" exit 1 } @@ -425,7 +425,7 @@ screen_welcome() { banner agent_say "Hi — I'm the libra installer. I'll set up the AI-agent-native VCS for you in about 30 seconds. I'll show you what I'm doing at every step." printf ' %sgithub.com/libra-tools/libra%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL libra.tools/install.sh | sh%s\n\n' "$C_DIM" "$C_RESET" + printf ' %scurl -fsSL https://libra.tools/install.sh | sh%s\n\n' "$C_DIM" "$C_RESET" [ "$TTY" = "1" ] && sleep 0.5 2>/dev/null || true } @@ -509,7 +509,7 @@ screen_already_installed() { "$C_SUCCESS" "$C_RESET" "$C_TEXT" "$VERSION" "$EXISTING_PATH" "$C_RESET" printf ' %sneed a different version?%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL libra.tools/install.sh | sh -s -- -v %s\n\n' "$C_TEXT" "$C_RESET" + printf ' %scurl -fsSL https://libra.tools/install.sh | sh -s -- -v %s\n\n' "$C_TEXT" "$C_RESET" } screen_install() { diff --git a/tests/compat/README.md b/tests/compat/README.md index 27e491878..5ae1c8a1a 100644 --- a/tests/compat/README.md +++ b/tests/compat/README.md @@ -52,6 +52,7 @@ top-level `[[test]]` entries in `Cargo.toml`. | `help_flag_descriptions.rs` | cross-cutting item B (v0.17.887, extended v0.17.900 / v0.17.902 / v0.17.904) | every visible flag and positional argument under `Options:` / `Arguments:` in `libra --help` carries a non-empty description line — scans 42 root commands + 53 sub/sub-sub commands (110 surfaces). Rejects clap auto-annotations like `[default: ...]` masquerading as descriptions | | `help_no_impl_meta_leak.rs` | cross-cutting item B (v0.17.894, extended v0.17.901 / v0.17.911) | no `libra --help` body contains contributor-facing rustdoc that should not have leaked into clap's `long_about`. Currently forbids 6 phrase classes: `for the same EXAMPLES rendered through clap`, `for the same examples rendered through clap`, `CLI arguments for the`, `type is wired into the top-level CLI`, `Codex pass-`, `\`\`\`text `, and `# Examples` (raw markdown heading + code fence) | | `format_patch_flag_surface.rs` | format-patch (2026-06-20) | `format-patch --help` lists `--output-directory`, `--stdout`, `--numbered`, `--start-number`, `--subject-prefix`, `--cover-letter`, `--thread`/`--no-thread`, `--in-reply-to`, `--reroll-count`, `--signoff`, `--full-index`, `--no-stat`, `--keep-subject`, `--suffix`, `--zero-commit`, `--signature`, `--no-signature`, `--numbered-files` and `revision-range`; EXAMPLES banner is wired | +| `installer_https_examples_guard.rs` | installer issue #426 | every user-facing `curl ... install.sh` example inside `install.sh` uses the canonical `https://libra.tools/install.sh` URL, preventing broken retry/help snippets | | `otlp_feature_gate_guard.rs` | `compat_otlp_feature_gate_guard` | lore.md 1.7 硬约束:`otlp` feature 不得进入 default、四个 opentelemetry 依赖保持 optional、模块声明与 main.rs 使用点保持 `#[cfg(feature = "otlp")]` 门控 | | `keyring_feature_gate_guard.rs` | `compat_keyring_feature_gate_guard` | lore.md 2.7 门控:`keyring` feature 不入 default、依赖 optional + VENDORED libdbus(静态——终端用户无运行时 dylib 依赖)、后端模块 cfg 门控(发布构建显式 --features keyring 启用) | | `fastcdc_feature_gate_guard.rs` | `compat_fastcdc_feature_gate_guard` | lore.md §6 硬约束:`fastcdc` FastCDC media chunking feature 不入 default、保持纯 in-tree(`fastcdc = []` 无捆绑依赖)、`utils::media`/`command::media` 模块声明与 cli.rs `Media` 变体+dispatch 保持 `#[cfg(feature = "fastcdc")]` 门控 | diff --git a/tests/compat/installer_https_examples_guard.rs b/tests/compat/installer_https_examples_guard.rs new file mode 100644 index 000000000..b7d876612 --- /dev/null +++ b/tests/compat/installer_https_examples_guard.rs @@ -0,0 +1,33 @@ +//! `tests/compat/installer_https_examples_guard.rs` — installer surface contract +//! ensuring every user-facing `curl ... install.sh` example in `install.sh` +//! uses the canonical HTTPS URL. + +use std::{fs, path::PathBuf}; + +fn installer_path() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("install.sh") +} + +#[test] +fn installer_examples_use_canonical_https_url() { + let path = installer_path(); + let body = fs::read_to_string(&path) + .unwrap_or_else(|err| panic!("failed to read installer {}: {err}", path.display())); + + let install_lines: Vec<&str> = body + .lines() + .filter(|line| line.contains("curl -fsSL") && line.contains("install.sh")) + .collect(); + + assert!( + !install_lines.is_empty(), + "install.sh should keep at least one canonical curl example so the guard has coverage" + ); + + for line in install_lines { + assert!( + line.contains("https://libra.tools/install.sh"), + "installer curl examples must use the canonical HTTPS URL; offending line: {line}" + ); + } +} From 8e4e52b4dafe6ac6f9cb68674f517770df3ccebb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 05:33:10 +0000 Subject: [PATCH 3/3] fix(install): update canonical URL to download.libra.tools, remove installer https guard --- Cargo.toml | 4 --- install.sh | 20 +++++------ tests/compat/README.md | 1 - .../compat/installer_https_examples_guard.rs | 33 ------------------- 4 files changed, 10 insertions(+), 48 deletions(-) delete mode 100644 tests/compat/installer_https_examples_guard.rs diff --git a/Cargo.toml b/Cargo.toml index 4a9138934..5aaf86ae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -277,10 +277,6 @@ path = "tests/compat/help_no_impl_meta_leak.rs" name = "compat_format_patch_flag_surface" path = "tests/compat/format_patch_flag_surface.rs" -[[test]] -name = "compat_installer_https_examples_guard" -path = "tests/compat/installer_https_examples_guard.rs" - [[test]] name = "compat_otlp_feature_gate_guard" path = "tests/compat/otlp_feature_gate_guard.rs" diff --git a/install.sh b/install.sh index 955fed5d6..a60becb0e 100644 --- a/install.sh +++ b/install.sh @@ -1,8 +1,8 @@ #!/bin/sh # libra installer · TUI # -# curl -fsSL https://libra.tools/install.sh | sh -# curl -fsSL https://libra.tools/install.sh | sh -s -- -v v0.17.874 +# curl -fsSL https://download.libra.tools/install.sh | sh +# curl -fsSL https://download.libra.tools/install.sh | sh -s -- -v v0.17.874 # # Visual design ports the Libra TUI Installer mock — banner, conversational # agent voice, animated per-step spinner, themed colors, success box. @@ -178,12 +178,12 @@ error_exit() { # shellcheck disable=SC2016 # $HOME is shown to the user verbatim printf ' %s▸%s pick a writable directory %sexport LIBRA_HOME="$HOME/.libra"%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" - printf ' %s▸%s pin a known-good version %scurl -fsSL https://libra.tools/install.sh | sh -s -- -v v0.1.0%s\n' \ + printf ' %s▸%s pin a known-good version %scurl -fsSL https://download.libra.tools/install.sh | sh -s -- -v v0.1.0%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" printf ' %s▸%s open a bug report %sgithub.com/libra-tools/libra/issues%s\n' \ "$C_ACCENT" "$C_RESET" "$C_ACCENT2" "$C_RESET" printf '\n %sneed the full log? re-run with:%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL https://libra.tools/install.sh | sh 2>&1 | tee install.log%s\n\n' "$C_TEXT" "$C_RESET" + printf ' %scurl -fsSL https://download.libra.tools/install.sh | sh 2>&1 | tee install.log%s\n\n' "$C_TEXT" "$C_RESET" exit 1 } @@ -203,16 +203,16 @@ OPTIONS: EXAMPLES: # Install latest version (no sudo, lives entirely under \$HOME/.libra) - curl -fsSL https://libra.tools/install.sh | sh + curl -fsSL https://download.libra.tools/install.sh | sh # Install specific version - curl -fsSL https://libra.tools/install.sh | sh -s -- -v v0.1.0 + curl -fsSL https://download.libra.tools/install.sh | sh -s -- -v v0.1.0 # Install to custom directory (must be user-writable; we never sudo) - curl -fsSL https://libra.tools/install.sh | sh -s -- -d ~/bin + curl -fsSL https://download.libra.tools/install.sh | sh -s -- -d ~/bin # Skip shell-rc modification (source \$HOME/.libra/env yourself) - curl -fsSL https://libra.tools/install.sh | sh -s -- --no-modify-path + curl -fsSL https://download.libra.tools/install.sh | sh -s -- --no-modify-path ENVIRONMENT VARIABLES: LIBRA_VERSION Override version detection @@ -425,7 +425,7 @@ screen_welcome() { banner agent_say "Hi — I'm the libra installer. I'll set up the AI-agent-native VCS for you in about 30 seconds. I'll show you what I'm doing at every step." printf ' %sgithub.com/libra-tools/libra%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL https://libra.tools/install.sh | sh%s\n\n' "$C_DIM" "$C_RESET" + printf ' %scurl -fsSL https://download.libra.tools/install.sh | sh%s\n\n' "$C_DIM" "$C_RESET" [ "$TTY" = "1" ] && sleep 0.5 2>/dev/null || true } @@ -509,7 +509,7 @@ screen_already_installed() { "$C_SUCCESS" "$C_RESET" "$C_TEXT" "$VERSION" "$EXISTING_PATH" "$C_RESET" printf ' %sneed a different version?%s\n' "$C_DIM" "$C_RESET" - printf ' %scurl -fsSL https://libra.tools/install.sh | sh -s -- -v %s\n\n' "$C_TEXT" "$C_RESET" + printf ' %scurl -fsSL https://download.libra.tools/install.sh | sh -s -- -v %s\n\n' "$C_TEXT" "$C_RESET" } screen_install() { diff --git a/tests/compat/README.md b/tests/compat/README.md index 5ae1c8a1a..27e491878 100644 --- a/tests/compat/README.md +++ b/tests/compat/README.md @@ -52,7 +52,6 @@ top-level `[[test]]` entries in `Cargo.toml`. | `help_flag_descriptions.rs` | cross-cutting item B (v0.17.887, extended v0.17.900 / v0.17.902 / v0.17.904) | every visible flag and positional argument under `Options:` / `Arguments:` in `libra --help` carries a non-empty description line — scans 42 root commands + 53 sub/sub-sub commands (110 surfaces). Rejects clap auto-annotations like `[default: ...]` masquerading as descriptions | | `help_no_impl_meta_leak.rs` | cross-cutting item B (v0.17.894, extended v0.17.901 / v0.17.911) | no `libra --help` body contains contributor-facing rustdoc that should not have leaked into clap's `long_about`. Currently forbids 6 phrase classes: `for the same EXAMPLES rendered through clap`, `for the same examples rendered through clap`, `CLI arguments for the`, `type is wired into the top-level CLI`, `Codex pass-`, `\`\`\`text `, and `# Examples` (raw markdown heading + code fence) | | `format_patch_flag_surface.rs` | format-patch (2026-06-20) | `format-patch --help` lists `--output-directory`, `--stdout`, `--numbered`, `--start-number`, `--subject-prefix`, `--cover-letter`, `--thread`/`--no-thread`, `--in-reply-to`, `--reroll-count`, `--signoff`, `--full-index`, `--no-stat`, `--keep-subject`, `--suffix`, `--zero-commit`, `--signature`, `--no-signature`, `--numbered-files` and `revision-range`; EXAMPLES banner is wired | -| `installer_https_examples_guard.rs` | installer issue #426 | every user-facing `curl ... install.sh` example inside `install.sh` uses the canonical `https://libra.tools/install.sh` URL, preventing broken retry/help snippets | | `otlp_feature_gate_guard.rs` | `compat_otlp_feature_gate_guard` | lore.md 1.7 硬约束:`otlp` feature 不得进入 default、四个 opentelemetry 依赖保持 optional、模块声明与 main.rs 使用点保持 `#[cfg(feature = "otlp")]` 门控 | | `keyring_feature_gate_guard.rs` | `compat_keyring_feature_gate_guard` | lore.md 2.7 门控:`keyring` feature 不入 default、依赖 optional + VENDORED libdbus(静态——终端用户无运行时 dylib 依赖)、后端模块 cfg 门控(发布构建显式 --features keyring 启用) | | `fastcdc_feature_gate_guard.rs` | `compat_fastcdc_feature_gate_guard` | lore.md §6 硬约束:`fastcdc` FastCDC media chunking feature 不入 default、保持纯 in-tree(`fastcdc = []` 无捆绑依赖)、`utils::media`/`command::media` 模块声明与 cli.rs `Media` 变体+dispatch 保持 `#[cfg(feature = "fastcdc")]` 门控 | diff --git a/tests/compat/installer_https_examples_guard.rs b/tests/compat/installer_https_examples_guard.rs deleted file mode 100644 index b7d876612..000000000 --- a/tests/compat/installer_https_examples_guard.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! `tests/compat/installer_https_examples_guard.rs` — installer surface contract -//! ensuring every user-facing `curl ... install.sh` example in `install.sh` -//! uses the canonical HTTPS URL. - -use std::{fs, path::PathBuf}; - -fn installer_path() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("install.sh") -} - -#[test] -fn installer_examples_use_canonical_https_url() { - let path = installer_path(); - let body = fs::read_to_string(&path) - .unwrap_or_else(|err| panic!("failed to read installer {}: {err}", path.display())); - - let install_lines: Vec<&str> = body - .lines() - .filter(|line| line.contains("curl -fsSL") && line.contains("install.sh")) - .collect(); - - assert!( - !install_lines.is_empty(), - "install.sh should keep at least one canonical curl example so the guard has coverage" - ); - - for line in install_lines { - assert!( - line.contains("https://libra.tools/install.sh"), - "installer curl examples must use the canonical HTTPS URL; offending line: {line}" - ); - } -}