feat(install): ask for QMD local search models and run the QMD installer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
953401a431
commit
505e6ae084
10 files changed
+48
-18
No files matched your search
@@ -17,6 +17,22 @@ try {
|
||||
if (Test-AllManifestsPresent @($installed, $missing)) { throw 'Update guard must fail when any selected destination is not installed.' }
|
||||
if (-not (Test-AllManifestsPresent @($installed))) { throw 'Update guard must pass when every selected destination is installed.' }
|
||||
|
||||
# QMD prompt: Auto maps device suitability; No never calls the benchmark.
|
||||
. (Join-Path $root 'scripts/lib/install-options.ps1')
|
||||
$originalIn = [Console]::In
|
||||
try {
|
||||
function Test-QmdDevice { param($RepositoryRoot, $HomePath) return $false }
|
||||
[Console]::SetIn([IO.StringReader]::new("a`n"))
|
||||
if ((Read-SemanticRetrievalOption -Default $false -RepositoryRoot $root -HomePath $work) -ne $false) { throw 'Auto unsuitable must yield false' }
|
||||
function Test-QmdDevice { param($RepositoryRoot, $HomePath) return $true }
|
||||
[Console]::SetIn([IO.StringReader]::new("a`n"))
|
||||
if ((Read-SemanticRetrievalOption -Default $false -RepositoryRoot $root -HomePath $work) -ne $true) { throw 'Auto suitable must yield true' }
|
||||
function Test-QmdDevice { throw 'must not run' }
|
||||
[Console]::SetIn([IO.StringReader]::new("n`n"))
|
||||
if ((Read-SemanticRetrievalOption -Default $true -RepositoryRoot $root -HomePath $work) -ne $false) { throw 'No must yield false' }
|
||||
} finally { [Console]::SetIn($originalIn) }
|
||||
if ((Get-Content -Raw (Join-Path $root 'scripts/lib/install-options.ps1')) -notmatch 'Enable local QMD search models \(Qwen3 embedding, Qwen3 reranker, QMD query expansion\)\? \[') { throw 'prompt text changed' }
|
||||
|
||||
if ($Summary) { Write-Output 'Tests: PASS | install guards' } else { Write-Output 'PASS install guards: already-installed and not-installed detection' }
|
||||
} finally {
|
||||
Remove-Item $work -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
@@ -25,4 +25,18 @@ any_manifest_present "$installed" "$missing" || { printf 'Expected an installed
|
||||
! all_manifests_present "$installed" "$missing" || { printf 'Update guard must fail when any selected destination is not installed.\n' >&2; exit 1; }
|
||||
all_manifests_present "$installed" || { printf 'Update guard must pass when every selected destination is installed.\n' >&2; exit 1; }
|
||||
|
||||
# QMD prompt: Auto maps benchmark exit codes; No never calls the benchmark.
|
||||
(
|
||||
home_path=$(mktemp -d)
|
||||
. "$root/scripts/lib/install-options.sh"
|
||||
test_qmd_device() { return 1; }
|
||||
[ "$(printf 'a\n' | read_semantic_retrieval_option false 2>/dev/null)" = false ] || { echo 'Auto unsuitable must yield false' >&2; exit 1; }
|
||||
test_qmd_device() { return 0; }
|
||||
[ "$(printf 'a\n' | read_semantic_retrieval_option false 2>/dev/null)" = true ] || { echo 'Auto suitable must yield true' >&2; exit 1; }
|
||||
test_qmd_device() { echo 'must not run' >&2; exit 9; }
|
||||
[ "$(printf 'n\n' | read_semantic_retrieval_option true 2>/dev/null)" = false ] || { echo 'No must yield false' >&2; exit 1; }
|
||||
printf 'n\n' | read_semantic_retrieval_option true 2>&1 >/dev/null | grep -q 'Enable local QMD search models' || { echo 'prompt text changed' >&2; exit 1; }
|
||||
rm -rf -- "$home_path"
|
||||
)
|
||||
|
||||
if [ "$summary" = true ]; then printf 'Tests: PASS | install guards\n'; else printf 'PASS install guards: already-installed and not-installed detection\n'; fi
|
||||
Reference in new issue
Block a user