fix: reconcile documentation guarantees and enforcement (OM-15)

This commit is contained in:
Chris Scott committed 2026-10-02 13:00:09 +00:00
1 parent 6c878ae79a
commit dcb50b7e0f
28 files changed
+461 -128

No files matched your search

+3 -2
View File
@@ -46,12 +46,13 @@ grant_kvm_access() {
OPENCODE_SUPPORTED_FLOOR="${OPENCODE_BUNDLED_VERSION:-}"
read_opencode_version() {
local binary
local binary output
binary="$(command -v "${1:-opencode}" 2>/dev/null || true)"
if [ -z "$binary" ] || [ ! -x "$binary" ]; then
return 0
fi
runuser -u node -- "$binary" --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true
output="$(runuser -u node -- "$binary" --version 2>&1)" || return 0
parse_opencode_version_output "$output"
}
install_opencode() {
+4
View File
@@ -23,6 +23,10 @@ version_gte() {
printf '%s\n%s\n' "$2" "$1" | sort -V -C
}
parse_opencode_version_output() {
printf '%s\n' "$1" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[^[:space:]]*' | head -1 || true
}
is_supported_opencode_version() {
local version="$1"
is_stable_opencode_version "$version" || return 1
+2 -1
View File
@@ -39,7 +39,8 @@ fi
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "$REPO_ROOT/scripts/lib/opencode-release.sh"
OPENCODE_SUPPORTED_FLOOR="$(sed -n 's/^ARG OPENCODE_VERSION=//p' "$REPO_ROOT/Dockerfile" | head -1)"
OPENCODE_VERSION="$(opencode --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)"
OPENCODE_VERSION_OUTPUT="$(opencode --version 2>&1)" || OPENCODE_VERSION_OUTPUT=""
OPENCODE_VERSION="$(parse_opencode_version_output "$OPENCODE_VERSION_OUTPUT")"
if [ -z "$OPENCODE_SUPPORTED_FLOOR" ] || ! is_supported_opencode_version "$OPENCODE_VERSION"; then
echo "❌ OpenCode ${OPENCODE_VERSION:-unknown} is not supported; OpenCode $(supported_opencode_range) is required. Please install it with:"