factory-ai-droid-cli-rnoz-bin

LOW
maintainer rNoz 0 votes scanned 2026-09-10 01:20:11.974213
View on AUR
Why flagged

The package downloads and verifies prebuilt binaries from the project's official domain (downloads.factory.ai), which is a trusted source; the build process is transparent and checksums are validated, posing minimal risk despite the binary-only distribution.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Low AI review llm_review

An AI model (qwen/qwen3-235b-a22b-2507) reviewed this and agrees it is LOW (confidence 95%): The package downloads and verifies prebuilt binaries from the project's official domain (downloads.factory.ai), which is a trusted source; the build process is transparent and checksums are validated, posing minimal risk despite the binary-only distribution.

PKGBUILD

1# Maintainer: rNoz <8237539+rNoz@users.noreply.github.com>
2pkgname=factory-ai-droid-cli-rnoz-bin
3pkgver=0.216.0
4pkgrel=1
5pkgdesc="Factory.ai Droid CLI - Always fresh terminal AI assistant with zero-waste deterministic titling"
6arch=('x86_64' 'aarch64')
7url="https://github.com/rNoz/factory-ai-droid-cli-rnoz"
8license=('factory.ai')
9depends=('curl')
10optdepends=(
11 'ripgrep: Use system ripgrep instead of bundled binary'
12)
13makedepends=('python')
14provides=('droid' 'factory-cli' 'factory-cli-bin')
15conflicts=('droid' 'factory-cli' 'factory-cli-bin')
16options=('!strip')
17install=factory-ai-droid-cli-rnoz-bin.install
18
19source=(
20 "patch-droid.py"
21 "$install"
22)
23sha256sums=(
24 '6f8fc3992526e8c8b0a4af11f029a633498f7704e9c6a736e772788d18243d00'
25 '7f443dc10fdafdcc197c287a2b6522ac1b8d45f8e2973d9405f1792a0f3eea95'
26)
27
28package() {
29 local actual_version="${pkgver}"
30 local platform="linux"
31
32 # Detect architecture
33 local architecture rg_architecture
34 case "$CARCH" in
35 x86_64)
36 architecture="x64"
37 ;;
38 aarch64)
39 architecture="arm64"
40 ;;
41 *)
42 error "Unsupported architecture: $CARCH"
43 return 1
44 ;;
45 esac
46
47 local base_url="https://downloads.factory.ai"
48 rg_architecture="$architecture"
49 local rg_url="$base_url/ripgrep/$platform/$rg_architecture/rg"
50 local rg_sha_url="$base_url/ripgrep/$platform/$rg_architecture/rg.sha256"
51
52 # Helper function to download, verify, and patch a droid binary variant
53 download_and_patch_droid() {
54 local arch_target="$1"
55 local output_bin="$2"
56 local raw_file="droid-${arch_target}.raw"
57 local sha_file="droid-${arch_target}.sha256"
58 local download_url="$base_url/factory-cli/releases/$actual_version/$platform/$arch_target/droid"
59 local sha_url="$base_url/factory-cli/releases/$actual_version/$platform/$arch_target/droid.sha256"
60
61 if [[ ! -f "$raw_file" ]]; then
62 msg2 "Downloading droid for $platform-$arch_target..."
63 curl -fsSL --retry 3 --retry-delay 2 --retry-connrefused -o "${raw_file}.part" "$download_url" || {
64 rm -f "${raw_file}.part"
65 error "Failed to download droid from $download_url"
66 return 1
67 }
68 mv -f "${raw_file}.part" "$raw_file"
69 fi
70
71 msg2 "Verifying upstream checksum for $arch_target..."
72 curl -fsSL --retry 3 --retry-delay 2 --retry-connrefused -o "${sha_file}.part" "$sha_url" || {
73 rm -f "${sha_file}.part"
74 error "Failed to download droid checksum for $arch_target"
75 return 1
76 }
77 mv -f "${sha_file}.part" "$sha_file"
78
79 local exp_sha act_sha
80 exp_sha=$(awk 'NF { print $1; exit }' "$sha_file")
81 act_sha=$(sha256sum "$raw_file" | awk '{print $1}')
82
83 if [[ ! "$exp_sha" =~ ^[[:xdigit:]]{64}$ || "$exp_sha" != "$act_sha" ]]; then
84 rm -f "$raw_file" "$sha_file"
85 error "Checksum verification failed for $arch_target!"
86 error "Expected: $exp_sha"
87 error "Actual: $act_sha"
88 return 1
89 fi
90 msg2 "Checksum verified for $arch_target"
91
92 msg2 "Applying zero-waste titling patch to $output_bin..."
93 cp -f "$raw_file" "$output_bin"
94 chmod +x "$output_bin"
95
96 python3 "$srcdir/patch-droid.py" "$output_bin" --test
97 }
98
99 if [[ "$architecture" == "x64" ]]; then
100 # Select the optimal single binary for the end system CPU.
101 # Users/maintainers can also force a specific variant via DROID_ARCH_VARIANT=baseline|avx2
102 if [[ "${DROID_ARCH_VARIANT:-}" == "baseline" ]]; then
103 msg2 "Building with baseline (non-AVX2) binary (forced via DROID_ARCH_VARIANT)..."
104 download_and_patch_droid "x64-baseline" "droid" || return 1
105 elif [[ "${DROID_ARCH_VARIANT:-}" == "avx2" ]]; then
106 msg2 "Building with AVX2-optimized binary (forced via DROID_ARCH_VARIANT)..."
107 download_and_patch_droid "x64" "droid" || return 1
108 elif [[ -f /proc/cpuinfo ]] && grep -qi avx2 /proc/cpuinfo 2>/dev/null; then
109 msg2 "Host CPU reports AVX2 support. Testing AVX2 binary execution..."
110 if download_and_patch_droid "x64" "droid"; then
111 msg2 "AVX2 binary operational and verified on host CPU."
112 else
113 msg2 "AVX2 binary not executable on this host (SIGILL/unsupported instructions). Falling back to baseline binary..."
114 rm -f "droid"
115 download_and_patch_droid "x64-baseline" "droid" || return 1
116 fi
117 else
118 msg2 "Host CPU lacks AVX2 support. Building with baseline (non-AVX2) binary..."
119 download_and_patch_droid "x64-baseline" "droid" || return 1
120 fi
121 else
122 download_and_patch_droid "arm64" "droid" || return 1
123 fi
124
125 # Download ripgrep binary
126 local raw_rg="rg"
127 local sha_rg="rg.sha256"
128 if [[ ! -f "$raw_rg" ]]; then
129 msg2 "Downloading ripgrep for $platform-$rg_architecture..."
130 curl -fsSL --retry 3 --retry-delay 2 --retry-connrefused -o "${raw_rg}.part" "$rg_url" || {
131 rm -f "${raw_rg}.part"
132 error "Failed to download ripgrep from $rg_url"
133 return 1
134 }
135 mv -f "${raw_rg}.part" "$raw_rg"
136 fi
137
138 # Download and verify ripgrep checksum
139 msg2 "Verifying ripgrep checksum..."
140 curl -fsSL --retry 3 --retry-delay 2 --retry-connrefused -o "${sha_rg}.part" "$rg_sha_url" || {
141 rm -f "${sha_rg}.part"
142 error "Failed to download ripgrep checksum"
143 return 1
144 }
145 mv -f "${sha_rg}.part" "$sha_rg"
146
147 local expected_rg_sha actual_rg_sha
148 expected_rg_sha=$(awk 'NF { print $1; exit }' "$sha_rg")
149 actual_rg_sha=$(sha256sum "$raw_rg" | awk '{print $1}')
150
151 if [[ ! "$expected_rg_sha" =~ ^[[:xdigit:]]{64}$ || "$expected_rg_sha" != "$actual_rg_sha" ]]; then
152 rm -f "$raw_rg" "$sha_rg"
153 error "Ripgrep checksum verification failed!"
154 error "Expected: $expected_rg_sha"
155 error "Actual: $actual_rg_sha"
156 return 1
157 fi
158 msg2 "Ripgrep checksum verified successfully"
159
160 # Create installation directories
161 install -dm755 "$pkgdir/usr/lib/factory"
162 install -dm755 "$pkgdir/usr/bin"
163
164 # Install single binary to /usr/lib/factory
165 install -Dm755 "droid" "$pkgdir/usr/lib/factory/droid"
166 install -Dm755 "rg" "$pkgdir/usr/lib/factory/rg"
167
168 # Create launcher script in /usr/bin/droid
169 cat > "$pkgdir/usr/bin/droid" <<'EOF'
170#!/bin/sh
171# Factory CLI launcher (Patched: zero title LLM token waste)
172export PATH="/usr/lib/factory:$PATH"
173exec /usr/lib/factory/droid "$@"
174EOF
175
176 chmod 755 "$pkgdir/usr/bin/droid"
177}
178

Scan history

Scanned at (UTC)SeverityRules
2026-09-10 01:20:11 Low 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion