Skip to content

ci: fix amicode-release UI gate check for the unconditional layout memo - #81

Merged
jack-champagne merged 1 commit into
local/amicodefrom
jack/fix-release-gate-check
Jul 28, 2026
Merged

ci: fix amicode-release UI gate check for the unconditional layout memo#81
jack-champagne merged 1 commit into
local/amicodefrom
jack/fix-release-gate-check

Conversation

@jack-champagne

Copy link
Copy Markdown
Member

Release blocker

ead3274d3 ("lock down appearance settings; force v2 layout", 2026-07-24 — after v1.17.3-amicode.9) changed settings.tsx to:

newLayoutDesigns: createMemo(() => true)

That minifies to newLayoutDesigns:Z(()=>!0). The gate check greps for the old channel-gated shape newLayoutDesigns,<VAR>), finds nothing, and exits 1.

Any release cut from current mainline fails the Gate check step and never publishes. Found while building the branch for #73 locally:

$ VAR=$(grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" | ...)
VAR=
FAIL: pattern not found

The change itself is good — the setting no longer depends on the build channel at all, so the original failure mode (channel latest/prod defaults it OFF) is structurally gone. Only the check needs to catch up.

Fix

Accept the new unconditional shape, keep the legacy channel-gated shape as a fallback in case the setting is ever rewired to the channel default, and still fail loudly on genuine drift.

Also fixes two latent set -e bugs that made this check exit silently rather than report:

  1. grep -aq '…' && { echo FAIL; exit 1; } — under set -e a non-matching grep in an AND-list aborts the whole step with no message.
  2. VAR=$(grep … | head … | sed …) — under set -o pipefail a no-match grep aborts the assignment. This is pre-existing: it means the existing "FAIL: gate pattern not found" diagnostic could never actually print. The step just died with no explanation, which is exactly what happened above.

Verification

Extracted check() from the workflow and ran it against four binaries:

case binary rc output
1 current build (shape A, ON) 0 OK: gate hardcoded ON (unconditional memo)
2 shipping vendored binary (legacy shape B, ON) 0 OK: gate ON (zG=!0)
3 build patched to (()=>!1) 1 FAIL: unconditional memo is OFF (=>!1)
4 build with the symbol renamed away 1 FAIL: gate pattern not found … (minifier drift? update this check)

Case 2 confirms the legacy path still works; cases 3 and 4 confirm it fails for the right reasons with a usable message.

Note

This is independent of #73 (the provider/model port) — it blocks releases either way and should land first.

ead3274 ("lock down appearance settings; force v2 layout") changed
settings.tsx to `newLayoutDesigns: createMemo(() => true)`. That minifies
to `newLayoutDesigns:<F>(()=>!0)`, so the gate check's grep for the old
channel-gated shape `newLayoutDesigns,<VAR>)` finds nothing and the step
exits 1 — blocking any release cut from current mainline.

Accepts the new unconditional shape, keeps the legacy channel-gated shape
as a fallback, and still fails loudly on real drift.

Also fixes two latent set -e bugs that made the check exit silently
instead of reporting: a `grep && { ... }` AND-list, and a `VAR=$(grep|...)`
assignment that aborts under pipefail when grep does not match — the
latter meant the existing "gate pattern not found" message could never fire.

Verified against four cases: current build (shape A on), the shipping
vendored binary (legacy shape B on), a binary patched to =>!1, and a
binary with the pattern removed. Correct rc and a diagnostic in each.
@jack-champagne
jack-champagne force-pushed the jack/fix-release-gate-check branch from 570545a to fc7be4a Compare July 28, 2026 22:47
@jack-champagne
jack-champagne merged commit 08b1b0a into local/amicode Jul 28, 2026
1 of 4 checks passed
jack-champagne added a commit to harmoniqs/amicode that referenced this pull request Jul 29, 2026
opencode ead3274d3 changed settings.tsx to
`newLayoutDesigns: createMemo(() => true)` — unconditional, no channel
dependency. That minifies to `newLayoutDesigns:Z(()=>!0)`, so the grep for
the old channel-gated shape `newLayoutDesigns,<VAR>)` finds nothing and
vsix-gate reds on any binary from amicode.10 onward.

Accept the new shape, keep the legacy channel-gated one as a fallback, and
still fail closed on a genuine gate-OFF build.

Also fixes the silent-failure bug: under `set -euo pipefail` the non-matching
grep aborted the script before its own "pattern not found" diagnostic could
print, so the job failed with no explanation.

Mirrors harmoniqs/opencode#81, which fixed the same two bugs in the fork's
release workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant