Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions packages/extension/opencode.lock.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"version": "1.17.3",
"repo": "harmoniqs/opencode",
"tag": "v1.17.3-amicode.9",
"tag": "v1.17.3-amicode.10",
"source": "release",
"ref": "bbe47b60bd7ffa0fabf96799fc134c57f69e0617",
"ref": "e0105cd4d0d517354daaf47f5fd3d4776d708bf8",
"platforms": {
"darwin-arm64": {
"asset": "opencode-darwin-arm64.zip",
"sha256": "315cecf7245d4ff7f9458f3d50dd19b73fc1b776642bbcdaf56777c6af318963"
"sha256": "8acd89f04da293a2e9097e7dc38cb2b20ccb638f778122bb0d17737f70a45209"
},
"linux-x64": {
"asset": "opencode-linux-x64.tar.gz",
"sha256": "733af61317fbf24325f9bb25d55ecb71c2dc1f08e2c18c9b7a853472412e7cf3"
"sha256": "0045b4a1e4235c5186db9540ef2d25dce74d4ffa2f0f0171a1d3d43515633f10"
}
}
}
23 changes: 20 additions & 3 deletions packages/extension/scripts/assert_ui_gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,26 @@ set -euo pipefail
BIN="${1:?usage: assert_ui_gate.sh <path-to-opencode-binary>}"
test -f "$BIN" || { echo "FAIL: no binary at $BIN"; exit 1; }

# Minified shape: `...general?.newLayoutDesigns,<VAR>)` where the default lands in
# <VAR> as `<VAR>=!0` (on) / `<VAR>=!1` (off).
VAR=$(grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" | head -1 | sed 's/newLayoutDesigns,//; s/)//')
# Shape A (current, since opencode ead3274d3 "lock down appearance settings;
# force v2 layout"): settings.tsx sets `newLayoutDesigns: createMemo(() => true)`
# — unconditional, no channel dependency. Minifies to `newLayoutDesigns:<F>(()=>!0)`.
# `if`, not `grep && { ... }`: under `set -e` a non-matching grep in an AND-list
# aborts the script with no message, which reads as a silent failure.
if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!0)' "$BIN"; then
echo "OK: amicode UI gate hardcoded ON (unconditional memo) — $BIN"
exit 0
fi
if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!1)' "$BIN"; then
echo "FAIL: amicode UI gate unconditional memo is OFF (=>!1) — $BIN"
exit 1
fi

# Shape B (legacy, channel-gated): `...general?.newLayoutDesigns,<VAR>)` where the
# default lands in <VAR> as `<VAR>=!0` (on) / `<VAR>=!1` (off). Kept so this check
# still works if the setting is ever rewired back to the channel default.
# `|| true`: under `set -o pipefail` a no-match grep would abort here, so the
# "pattern not found" diagnostic below could never fire.
VAR=$( { grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" || true; } | head -1 | sed 's/newLayoutDesigns,//; s/)//')
test -n "$VAR" || { echo "FAIL: gate pattern not found in $BIN (minifier drift? update this check)"; exit 1; }

if grep -aq "[^A-Za-z0-9_\$]${VAR}=!0" "$BIN"; then
Expand Down
Loading