From d83ff61d1dbec67216e4a8a3ef9a34098e244e9e Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 04:47:56 -0500 Subject: [PATCH 01/21] Wait for the agent to complete the reminder before checking the banner write --- apps/app/test/reminders.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/app/test/reminders.test.tsx b/apps/app/test/reminders.test.tsx index 0b0de7aef8..7d11599e20 100644 --- a/apps/app/test/reminders.test.tsx +++ b/apps/app/test/reminders.test.tsx @@ -632,9 +632,11 @@ describe("Reminders full journeys", () => { await later(alpha, 10 * 60_000 + 1_000); await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId > 0); await press("Complete"); - await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId === 0); + await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId === 0 + && recorder.snapshot.items.some((row) => row.id === item!.id && row.completed)); expect(storeView().snapshot.items.find((i) => i.id === item!.id)?.completed).toBe(true); - expect(recorder.calls.some((c) => c.method === "POST" && c.path.endsWith("/complete") && c.body.item !== undefined)).toBe(true); + expect(recorder.calls.filter((call) => call.method === "POST" && call.path === `/api/alpha/reminders/items/${item!.id}/complete`)) + .toMatchObject([{ body: { item: { id: item!.id, completed: true } } }]); // spec/app/reminders/index.md, "Refreshing fetches under the next ticket, only the newest answer settles, and a change from chat refreshes once free" const chatItem: ReminderItemRecord = { From fecec06c36ca30c493199a7dc02beef64e1e1410 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:05:31 -0500 Subject: [PATCH 02/21] Deliver launcher preparation to a sleeping WebView without bypassing draft review --- .../alphaphone/AlphaDevicePlugin.java | 17 +++- .../alphaphone/LauncherPageReplies.java | 91 +++++++++++++++++++ .../alphaphone/LauncherUpdateCoordinator.java | 4 + .../alphaphone/LauncherUpdatePolicy.java | 23 +++-- apps/app/src/platform/launcherUpdates.vibe | 31 ++++++- apps/app/test/android.test.ts | 9 ++ apps/app/test/notes.test.tsx | 34 +++++-- apps/app/test/update.test.tsx | 2 +- 8 files changed, 189 insertions(+), 22 deletions(-) create mode 100644 apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/AlphaDevicePlugin.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/AlphaDevicePlugin.java index 5b1c81abd2..be0f51921c 100644 --- a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/AlphaDevicePlugin.java +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/AlphaDevicePlugin.java @@ -405,9 +405,13 @@ static JSObject openUpdatePermissionSettingsHeadless(Context context) { private final String updateBridgeId = java.util.UUID.randomUUID().toString(); private volatile boolean updateDestroyed; + private LauncherPageReplies updatePage; private final LauncherUpdateCoordinator.BridgeClient updateClient = new LauncherUpdateCoordinator.BridgeClient() { @Override public String bridgeId() { return updateBridgeId; } - @Override public void notifyListeners(String event, JSObject data) { AlphaDevicePlugin.this.notifyListeners(event, data); } + @Override public void notifyListeners(String event, JSObject data) { + updatePage.changed(); + getBridge().executeOnMainThread(() -> AlphaDevicePlugin.this.notifyListeners(event, data)); + } @Override public android.app.Activity activity() { return getActivity(); } @Override public boolean isDestroyed() { return updateDestroyed; } @Override public boolean inFront() { return AlphaDevicePlugin.this.inFront(); } @@ -465,11 +469,11 @@ private void openInstallSourceSettings(PluginCall call, JSObject result) { } @PluginMethod public void activateUpdate(PluginCall call) { - LauncherUpdateCoordinator.get(getContext()).activateUpdate(updateClient, call); + updatePage.call(call, true, reply -> LauncherUpdateCoordinator.get(getContext()).activateUpdate(updateClient, reply)); } @PluginMethod public void updateState(PluginCall call) { - LauncherUpdateCoordinator.get(getContext()).updateState(updateClient, diagnosticsWorker, call); + updatePage.call(call, false, reply -> LauncherUpdateCoordinator.get(getContext()).updateState(updateClient, diagnosticsWorker, reply)); } @PluginMethod public void continueUpdate(PluginCall call) { @@ -487,7 +491,10 @@ private void openInstallSourceSettings(PluginCall call, JSObject result) { @Override public void load() { super.load(); updateDestroyed = false; - LauncherUpdateCoordinator.get(getContext()).registerBridge(updateClient); + LauncherUpdateCoordinator coordinator = LauncherUpdateCoordinator.get(getContext()); + updatePage = new LauncherPageReplies(getBridge(), () -> coordinator.documentChanged(updateClient)); + getBridge().addWebViewListener(updatePage); + coordinator.registerBridge(updateClient); } @Override protected void handleOnResume() { @@ -497,6 +504,8 @@ private void openInstallSourceSettings(PluginCall call, JSObject result) { @Override protected void handleOnDestroy() { updateDestroyed = true; + getBridge().removeWebViewListener(updatePage); + updatePage.closed(); LauncherUpdateCoordinator.get(getContext()).retireBridge(updateClient); diagnosticsWorker.shutdown(); super.handleOnDestroy(); diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java new file mode 100644 index 0000000000..a094c70bec --- /dev/null +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java @@ -0,0 +1,91 @@ +// spec/app/update/page.md, "An update read under another bridge is never taken up or answered by this page"; spec/app/update/index.md, "A page lets a hands-off update go ahead while the owner is idle with no call and normal audio, on screen or asleep" +package ai.alphacompute.alphaphone; + +import android.webkit.WebView; +import com.getcapacitor.Bridge; +import com.getcapacitor.JSObject; +import com.getcapacitor.PluginCall; +import com.getcapacitor.WebViewListener; +import java.util.function.Consumer; +import java.util.regex.Pattern; +import org.json.JSONObject; + +/** Delivers the updater's Capacitor replies to the packaged document that made the call, including while its WebMessage queue sleeps. */ +final class LauncherPageReplies extends WebViewListener { + private static final Pattern DOCUMENT = Pattern.compile("[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}"); + private static final String PACKAGED = "window.top===window && window.location.origin==='https://localhost'"; + private final Bridge bridge; + private final Runnable navigating; + private volatile long generation; + private volatile boolean closed; + + LauncherPageReplies(Bridge bridge, Runnable navigating) { + this.bridge = bridge; + this.navigating = navigating; + } + + @Override public void onPageStarted(WebView view) { + generation++; + navigating.run(); + } + + void closed() { + closed = true; + generation++; + } + + void changed() { + if (!closed && bridge.getServerUrl() == null) { + bridge.eval("if (" + PACKAGED + ") window.dispatchEvent(new Event('alpha-launcher-update-changed'))", null); + } + } + + void call(PluginCall original, boolean answering, Consumer run) { + String document = original.getString("launcherDocument"); + if (!original.getData().has("launcherDocument") || bridge.getServerUrl() != null) { + run.accept(original); + return; + } + if (closed || document == null || !DOCUMENT.matcher(document).matches()) { + original.reject("Update document changed"); + return; + } + Reply reply = new Reply(original, document, generation); + if (!answering) { + run.accept(reply); + return; + } + bridge.eval(reply.current, matching -> { + if (!closed && generation == reply.visit && "true".equals(matching)) run.accept(reply); + else reply.reject("Update document changed"); + }); + } + + private final class Reply extends PluginCall { + private final PluginCall original; + private final String current; + private final long visit; + + Reply(PluginCall original, String document, long visit) { + super(null, original.getPluginId(), original.getCallbackId(), original.getMethodName(), original.getData()); + this.original = original; + this.current = PACKAGED + " && window.alphaLauncherUpdateDocument===" + JSONObject.quote(document); + this.visit = visit; + } + + private void finish(boolean success, JSObject value) { + if (visit == generation) { + JSObject result = new JSObject().put("callbackId", getCallbackId()).put("pluginId", getPluginId()) + .put("methodName", getMethodName()).put("save", false).put("success", success).put(success ? "data" : "error", value); + bridge.eval("if (" + current + ") window.Capacitor.fromNative(" + result + ")", null); + } + original.release(bridge); + } + + @Override public void resolve() { resolve(new JSObject()); } + @Override public void resolve(JSObject data) { finish(true, data); } + @Override public void reject(String message, String code, Exception cause, JSObject data) { + finish(false, new JSObject().put("message", message).put("code", code)); + } + } +} diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdateCoordinator.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdateCoordinator.java index f300c083ba..d10c886536 100644 --- a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdateCoordinator.java +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdateCoordinator.java @@ -373,6 +373,10 @@ void registerBridge(BridgeClient bridge) { }, () -> {}); } + void documentChanged(BridgeClient bridge) { + BARRIER.documentChanged(bridge); + } + void retireBridge(BridgeClient bridge) { BARRIER.retire(bridge); if (activeForegroundOwner == bridge) { diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdatePolicy.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdatePolicy.java index ce0591b886..c82a8336e5 100644 --- a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdatePolicy.java +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherUpdatePolicy.java @@ -594,18 +594,25 @@ Preparation register(B bridge) { } } + private void invalidateUnsealed() { + if (activation != null && !activation.sealed) { + activation.invalid = true; + activation.ready.complete(false); + } + } + + void documentChanged(B bridge) { + synchronized (lock) { + if (bridges.contains(bridge)) invalidateUnsealed(); + } + } + void retire(B bridge) { synchronized (lock) { bridges.remove(bridge); if (bridge.bridgeId().equals(settledResumeBridge)) settledResumeBridge = null; - Preparation pending = activation; - if (pending != null) { - if (pending.owner == bridge) pending.ready.complete(false); - if (!pending.sealed) { - pending.invalid = true; - pending.ready.complete(false); - } - } + if (activation != null && activation.owner == bridge) activation.ready.complete(false); + invalidateUnsealed(); } } diff --git a/apps/app/src/platform/launcherUpdates.vibe b/apps/app/src/platform/launcherUpdates.vibe index b053701e40..027f0f3219 100644 --- a/apps/app/src/platform/launcherUpdates.vibe +++ b/apps/app/src/platform/launcherUpdates.vibe @@ -13,14 +13,40 @@ module native { export const ready = "alphaUpdateReady" export const settled = "alphaUpdateSettled" - /** The single Capacitor proxy registered for Alpha's updater. @throws {never} */ - export function updater(): LauncherUpdatePlugin { return plugin(name) } + type Visit = { readonly launcherDocument: string } + type Answer = Parameters[0] + type PagePlugin = LauncherUpdatePlugin & { + updateState(options: Visit): ReturnType + activateUpdate(options: Answer & Visit): ReturnType + } + + /** The packaged document that owns the in-flight Capacitor response callbacks. @throws {never} */ + export function updater(): LauncherUpdatePlugin { + const phone = plugin(name) + if (typeof window === "undefined") return phone + const page: Window & { alphaLauncherUpdateDocument?: string } = window + const launcherDocument = page.alphaLauncherUpdateDocument ?? crypto.randomUUID() + if (!page.alphaLauncherUpdateDocument) Object.defineProperty(page, "alphaLauncherUpdateDocument", { value: launcherDocument }) + const visit = { launcherDocument } + return { + snapshot: () => phone.snapshot(), + checkForUpdate: () => phone.checkForUpdate(), + installUpdate: (options) => phone.installUpdate(options), + updateState: () => phone.updateState(visit), + activateUpdate: (options) => phone.activateUpdate({ ...options, ...visit }), + continueUpdate: (options) => phone.continueUpdate(options), + openUpdatePermissionSettings: () => phone.openUpdatePermissionSettings(), + addListener: (event, heard) => phone.addListener(event, heard), + } + } /** Capacitor reports native listener errors on the callback and returns a callback ID only after dispatch. @throws {never} */ export function listen(wake: () => void, refused: (event: string) => void): () => void { const bridge = (globalThis as { Capacitor?: Partial> }).Capacitor let observer: { wake: () => void; refused: (event: string) => void } | undefined = { wake, refused } const handles = new Map() + const changed = () => observer?.wake() + window.addEventListener("alpha-launcher-update-changed", changed) for (const eventName of [ready, settled]) { try { const callbackId = bridge?.nativeCallback?.(name, "addListener", { eventName }, (_, error) => { @@ -39,6 +65,7 @@ module native { } return () => { observer = undefined + window.removeEventListener("alpha-launcher-update-changed", changed) for (const [eventName, callbackId] of handles) { try { bridge?.nativeCallback?.(name, "removeListener", { eventName, callbackId }) } catch { continue } } diff --git a/apps/app/test/android.test.ts b/apps/app/test/android.test.ts index 1dfc2c56e0..38c55d6858 100644 --- a/apps/app/test/android.test.ts +++ b/apps/app/test/android.test.ts @@ -325,6 +325,14 @@ public final class Driver { var ret = retireBarrier.begin(bt, true); retireBarrier.retire(bt); System.out.println("retire " + ret.preparation().ready.get(200, TimeUnit.MILLISECONDS)); + retireBarrier.register(bt); + var previousDocument = retireBarrier.begin(null, true).preparation(); + retireBarrier.documentChanged(bt); + var currentDocument = retireBarrier.begin(null, true).preparation(); + System.out.println("navigation " + previousDocument.ready.get(200, TimeUnit.MILLISECONDS) + " " + + retireBarrier.acknowledge(bt, previousDocument.id, bt.bridgeId(), true, true) + " " + + retireBarrier.acknowledge(bt, currentDocument.id, bt.bridgeId(), true, true) + " " + + currentDocument.ready.get(200, TimeUnit.MILLISECONDS)); } } `; @@ -554,6 +562,7 @@ describe("Native launcher OTA policy, staging, quarantine, barrier and durable p "multi 2 false true false true true true 2 bridge-1", "refuse false", "retire false", + "navigation false false true true", ]); }); diff --git a/apps/app/test/notes.test.tsx b/apps/app/test/notes.test.tsx index 3160d662e4..c2fc7fb012 100644 --- a/apps/app/test/notes.test.tsx +++ b/apps/app/test/notes.test.tsx @@ -15,6 +15,7 @@ import { Machine as Trash } from "../gen/app__notes__trash.effect.vibe"; import { Machine as Voice } from "../gen/app__notes__voice.effect.vibe"; import { Machine as List, nothing, writing as listWriting } from "../gen/app__notes.effect.vibe"; import { Machine as Talk } from "../gen/app__voice.effect.vibe"; +import { Machine as UpdatePage } from "../gen/app__update__page.effect.vibe"; import { Machine as Shell, showing } from "../gen/app__shell.effect.vibe"; import assistant from "../src/assistant/index.tsx"; import { Views } from "../src/assistant/views.vibe"; @@ -31,7 +32,7 @@ import { cloudAt } from "../src/platform/cloud.vibe"; import { IosElizaAgentHost, iosAgentFor } from "../src/platform/index.vibe"; import { pagePlatform } from "../src/platform/platform.vibe"; import { untimed } from "../src/runtime/reactor.vibe"; -import { button, closeAll, drawn, fill, hardware, later, only, open, openOver, press, pressOnTop, underAct, until } from "./alpha.tsx"; +import { button, closeAll, drawn, fill, hardware, later, only, open, openOver, press, pressOnTop, seen, underAct, until } from "./alpha.tsx"; import { note, notesRoutes, prepared } from "./fakes/notes.ts"; import { freshIosStores } from "./fakes/ios.ts"; import { type Answering, answering, fetched } from "./fakes/routes.ts"; @@ -345,8 +346,8 @@ describe("Notes", () => { }); it("Write a note (spec/app/notes/editor.md, \"Story: Write a note\")", async () => { - const world = scene(); - const { alpha, runtime } = await openNotesFromHome(world); + const world = { ...scene(), phone: true }; + const { alpha, runtime, close } = await openNotesFromHome(world); await until(alpha, runtime, List, (s) => s.read.status === "Loaded"); // spec/app/notes/index.md, "A voice note opens only as a voice note, a link note only in its dialog, and text and checklists only in the editor" @@ -357,22 +358,41 @@ describe("Notes", () => { // spec/app/notes/editor.md, "The owner types, adds or ticks an item, and the phone keeps the draft within a second, and at once when the note closes, Notes is left or Alpha goes to the background" await fill("Title", "Enclave launch plan"); await until(alpha, runtime, Editor, (s) => s.draft.sync === "Edited"); + // spec/app/update/page.md, "A page is ready for an update only with no voice turn, connection step, call or recording under way, and for a hands-off update only while the phone is still idle" + await seen(false); + world.update.state = { pending: true, phase: "preparing", activationId: "editing", bridgeId: "notes-page", automatic: true }; + window.dispatchEvent(new Event("alpha-launcher-update-changed")); + await until(alpha, alpha.runtime, UpdatePage, (s) => s.reply === "Refused"); + expect(world.update.answers).toEqual([{ activationId: "editing", ready: false }]); + world.update.state = { idle: true, activationId: "editing", bridgeId: "notes-page", outcome: "canceled" }; + window.dispatchEvent(new Event("alpha-launcher-update-changed")); + await until(alpha, alpha.runtime, UpdatePage, (s) => s.activation === 0 && !s.frozen); + await seen(true); await hardware("home"); await until(alpha, runtime, Editor, (s) => !s.showing && waiting(s)); const content = runtime.runSync(NoteContent); const kept = await runtime.runPromise(content.rawDraft(content.snapshot().collection.owner)); expect(JSON.parse(kept ?? "{}")).toMatchObject({ id: "enclave", title: "Enclave launch plan" }); - await drawn(() => runtime.runPromise(Effect.flatMap(Shell, (shell) => shell.send({ type: "openView", view: "Notes" })))); + // spec/app/update/index.md, "A page lets a hands-off update go ahead while the owner is idle with no call and normal audio, on screen or asleep" + await seen(false); + world.update.state = { pending: true, phase: "preparing", activationId: "home", bridgeId: "notes-page", automatic: true }; + window.dispatchEvent(new Event("alpha-launcher-update-changed")); + await until(alpha, alpha.runtime, UpdatePage, (s) => s.reply === "Readied"); + expect(world.update.answers).toEqual([{ activationId: "editing", ready: false }, { activationId: "home", ready: true }]); + await close(); + world.update.state = { idle: true }; + await seen(true); + const reopened = await openNotesFromHome(world); await control("Reopen"); await press("Reopen"); - await until(alpha, runtime, Editor, (s) => s.showing && s.draft.sync === "Edited"); + await until(reopened.alpha, reopened.runtime, Editor, (s) => s.showing && s.draft.sync === "Edited"); expect(editorTitle()).toBe("Enclave launch plan"); // spec/app/notes/editor.md, "A save lands, finds a newer revision, finds the note deleted, or fails, and only the phone's answer to the last save counts" await press("Done"); - await until(alpha, runtime, Editor, (s) => !s.showing && s.draft.sync === "Kept"); + await until(reopened.alpha, reopened.runtime, Editor, (s) => !s.showing && s.draft.sync === "Kept"); expect(world.notes.notes.find((note) => note.id === "enclave")?.title).toBe("Enclave launch plan"); - await until(alpha, runtime, List, (s) => s.read.status === "Loaded" && s.version === world.notes.revision + 1); + await until(reopened.alpha, reopened.runtime, List, (s) => s.read.status === "Loaded" && s.version === world.notes.revision + 1); }); it('Pins the exact saved voice note from More (spec/app/notes/voice.md, "Pinning writes the chosen flag over the revision shown")', async () => { diff --git a/apps/app/test/update.test.tsx b/apps/app/test/update.test.tsx index 682f715700..857b4bff73 100644 --- a/apps/app/test/update.test.tsx +++ b/apps/app/test/update.test.tsx @@ -385,7 +385,7 @@ describe("Updates", () => { // spec/app/update/index.md, "A page lets a hands-off update go ahead while the owner is idle with no call and normal audio, on screen or asleep": asleep on Home, the page lets Android's background update go ahead. await seen(false); world.update.state = { pending: true, phase: "preparing", activationId: "a9", bridgeId: "b9", automatic: true }; - tell(world.update, "alphaUpdateReady"); + window.dispatchEvent(new Event("alpha-launcher-update-changed")); await until(alpha, alpha.runtime, Page.Machine, (s) => s.reply === "Readied"); expect(world.update.answers).toEqual([{ activationId: "a9", ready: true }]); await seen(true); From 0697252c1f384d59c60f3a8e9f25f054bfb1acaa Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:06:42 -0500 Subject: [PATCH 03/21] Invalidate outstanding preparations when Android loses the renderer --- .../alphacompute/alphaphone/LauncherPageReplies.java | 10 +++++++++- apps/app/test/android.test.ts | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java index a094c70bec..b433480f94 100644 --- a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java @@ -1,6 +1,7 @@ // spec/app/update/page.md, "An update read under another bridge is never taken up or answered by this page"; spec/app/update/index.md, "A page lets a hands-off update go ahead while the owner is idle with no call and normal audio, on screen or asleep" package ai.alphacompute.alphaphone; +import android.webkit.RenderProcessGoneDetail; import android.webkit.WebView; import com.getcapacitor.Bridge; import com.getcapacitor.JSObject; @@ -24,11 +25,18 @@ final class LauncherPageReplies extends WebViewListener { this.navigating = navigating; } - @Override public void onPageStarted(WebView view) { + private void documentChanged() { generation++; navigating.run(); } + @Override public void onPageStarted(WebView view) { documentChanged(); } + + @Override public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) { + documentChanged(); + return false; + } + void closed() { closed = true; generation++; diff --git a/apps/app/test/android.test.ts b/apps/app/test/android.test.ts index 38c55d6858..2a65afa331 100644 --- a/apps/app/test/android.test.ts +++ b/apps/app/test/android.test.ts @@ -333,6 +333,11 @@ public final class Driver { + retireBarrier.acknowledge(bt, previousDocument.id, bt.bridgeId(), true, true) + " " + retireBarrier.acknowledge(bt, currentDocument.id, bt.bridgeId(), true, true) + " " + currentDocument.ready.get(200, TimeUnit.MILLISECONDS)); + retireBarrier.documentChanged(bt); + boolean sealAfterNavigation = false; + try { retireBarrier.seal(currentDocument); sealAfterNavigation = true; } + catch (IOException expected) {} + System.out.println("sealAfterNavigation " + sealAfterNavigation); } } `; @@ -563,6 +568,7 @@ describe("Native launcher OTA policy, staging, quarantine, barrier and durable p "refuse false", "retire false", "navigation false false true true", + "sealAfterNavigation false", ]); }); From 1934626f1b44170afb0a16925495969e3afdc726 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:24:57 -0500 Subject: [PATCH 04/21] Require the originating document on every packaged update acknowledgement --- .../java/ai/alphacompute/alphaphone/LauncherPageReplies.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java index b433480f94..ce54a88645 100644 --- a/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java +++ b/apps/app/android/app/src/main/java/ai/alphacompute/alphaphone/LauncherPageReplies.java @@ -50,7 +50,7 @@ void changed() { void call(PluginCall original, boolean answering, Consumer run) { String document = original.getString("launcherDocument"); - if (!original.getData().has("launcherDocument") || bridge.getServerUrl() != null) { + if (bridge.getServerUrl() != null || (!answering && !original.getData().has("launcherDocument"))) { run.accept(original); return; } From 8943c502dabad8c4b2719c499579bee2a9315637 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:51:40 -0500 Subject: [PATCH 05/21] Run the launcher's update page while Android suspends browser timers --- apps/app/src/update/page.vibe | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/app/src/update/page.vibe b/apps/app/src/update/page.vibe index 6720945bb3..f086e6b030 100644 --- a/apps/app/src/update/page.vibe +++ b/apps/app/src/update/page.vibe @@ -1,5 +1,6 @@ // spec/app/update/page.md, "Story: Open Alpha while an update is pending"; spec/app/update/page.md, "Story: Save my work before Alpha updates"; spec/app/update/page.md, "Story: Carry on after the update" import { LauncherActivations, LauncherClock, LauncherPageMachine, followLauncherPage, launcherActivations } from "@elizaos/os-bridges" +import { MixedScheduler, Scheduler } from "effect/Scheduler" import * as Page from "../../gen/app__update__page.effect.vibe" import type { Effect as Out, Engaged, Event } from "../../gen/app__update__page.effect.vibe" import * as Layers from "../../gen/app__shell__layers.effect.vibe" @@ -65,7 +66,7 @@ const followed = started(effect { const page = try Page.Machine const time = try Time const front = Stream.filter((try Device).visible, (shown) => shown) - provide LauncherPageMachine = page, LauncherClock = time { try followLauncherPage(front) } + provide LauncherPageMachine = page, LauncherClock = time, Scheduler = new MixedScheduler("sync") { try followLauncherPage(front) } }, "following Android's activation of an update") // spec/app/update/page.md, "A mounted page's navigation is frozen exactly while an update is pending"; spec/app/shell/layers.md, "Something holds the phone until it lets go, and each holder holds it once" From 85bdbbdf3624ab65c47174b3c1d730a75d2bfe67 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 08:15:30 -0500 Subject: [PATCH 06/21] Retain the update scheduler when running the page's draft and answer jobs --- apps/app/src/update/page.vibe | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/app/src/update/page.vibe b/apps/app/src/update/page.vibe index f086e6b030..65ba1e39df 100644 --- a/apps/app/src/update/page.vibe +++ b/apps/app/src/update/page.vibe @@ -6,7 +6,7 @@ import type { Effect as Out, Engaged, Event } from "../../gen/app__update__page. import * as Layers from "../../gen/app__shell__layers.effect.vibe" import * as Updates from "../../gen/app__update.effect.vibe" import { Agent, Device, LauncherUpdates } from "../platform/index.vibe" -import { type Job, answer, contained, reacting, run, started, together, Time } from "../runtime/index.vibe" +import { type Job, answer, contained, reacting, run, started, together, Time, Whole } from "../runtime/index.vibe" import type * as Toasts from "../../gen/app__notices__toasts.effect.vibe" import { type Said, say } from "../notices/index.vibe" import { Engagements } from "./activity.vibe" @@ -59,14 +59,18 @@ function carry(fx: Out): Job ({ + ...whole, + context: Effect.map(whole.context, (services) => Context.add(services, Scheduler, pageScheduler)), +})) // spec/app/update/page.md, "While an update is pending or the page holds, Android's activation is read again every second" const followed = started(effect { const page = try Page.Machine const time = try Time const front = Stream.filter((try Device).visible, (shown) => shown) - provide LauncherPageMachine = page, LauncherClock = time, Scheduler = new MixedScheduler("sync") { try followLauncherPage(front) } + provide LauncherPageMachine = page, LauncherClock = time, Scheduler = pageScheduler { try followLauncherPage(front) } }, "following Android's activation of an update") // spec/app/update/page.md, "A mounted page's navigation is frozen exactly while an update is pending"; spec/app/shell/layers.md, "Something holds the phone until it lets go, and each holder holds it once" From 2df36c7397fda98faf45b9fe46bec51bdd9bc46c Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 07:04:46 -0500 Subject: [PATCH 07/21] Download and verify the whole GitHub OTA in the workstation handoff --- docs/development.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/development.md b/docs/development.md index 0c3ed18f89..a8ce73e745 100644 --- a/docs/development.md +++ b/docs/development.md @@ -517,10 +517,10 @@ that reuses the same launcher has its own `alpha-os-` release if that launcher version already has a completed bundle. Use that tag in the same download command. -Verify the files from the empty download directory. When GitHub holds the -image in parts, the index lists them in assembly order. This command reads -each part in that order, verifies every byte count and SHA-256, and verifies -the complete image before saving it under its release filename. +Verify the files from the download directory. This also downloads the whole OTA +for this release, even after a newer OTA reaches the channel. When GitHub holds +the factory image in parts, the command assembles them in index order and checks +the complete image. Each file is checked against its indexed size and SHA-256. ```sh ( @@ -534,7 +534,8 @@ the complete image before saving it under its release filename. } rows=$(mktemp .release-files.XXXXXX) joined=$(mktemp .fastboot-image.XXXXXX) - trap 'rm -f "$rows" "$joined"' EXIT + partial=$(mktemp .os-ota.XXXXXX) + trap 'rm -f "$rows" "$joined" "$partial"' EXIT jq -er '([.apk, .avb] + .fastboot.parts)[] | [.name, .bytes, .sha256] | @tsv' "$index" > "$rows" while IFS="$(printf '\t')" read -r name bytes sha; do case "$name" in ''|.*|*/*) exit 1 ;; esac @@ -551,13 +552,22 @@ the complete image before saving it under its release filename. check_file "$joined" "$bytes" "$digest" mv "$joined" "./$image" fi - printf 'Verified %s and the APK and AVB key.\n' "$image" + ota_url=$(jq -er '.ota.url | select(test("^https://github[.]com/AlphaPhone/alpha/releases/download/os-pilot/[A-Za-z0-9][A-Za-z0-9._-]{0,127}[.]zip$"))' "$index") + ota=${ota_url##*/} + bytes=$(jq -er .ota.bytes "$index") + digest=$(jq -er .ota.sha256 "$index") + if [ -f "./$ota" ]; then + check_file "./$ota" "$bytes" "$digest" + else + curl --fail --silent --show-error --location --proto '=https' --proto-redir '=https' --retry 3 --output "$partial" "$ota_url" + check_file "$partial" "$bytes" "$digest" + mv "$partial" "./$ota" + fi + printf 'Verified %s, %s, the APK and the AVB key.\n' "$image" "$ota" ) ``` -To download the OTA separately, use `.ota.url` in the index, then check its -byte length and SHA-256 against `.ota.bytes` and `.ota.sha256`. Android's OS -updater continues to fetch one whole archive from its reviewed pilot manifest. +Android's OS updater fetches the same whole archive from its reviewed pilot manifest. [GitHub Releases](https://github.com/AlphaPhone/alpha/releases) A Pixel build for an existing launcher publication can be dispatched with From 1dce414ed65284f3ba81ba08a07c2546ce8e39a0 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 08:35:47 -0500 Subject: [PATCH 08/21] Pin production to the merged Pixel image SDK --- apps/app/public/licenses/THIRD_PARTY_NOTICES.txt | 2 +- apps/app/public/licenses/third-party-notices.json | 2 +- eliza.lock.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/app/public/licenses/THIRD_PARTY_NOTICES.txt b/apps/app/public/licenses/THIRD_PARTY_NOTICES.txt index 2550d4aaaf..15704476be 100644 --- a/apps/app/public/licenses/THIRD_PARTY_NOTICES.txt +++ b/apps/app/public/licenses/THIRD_PARTY_NOTICES.txt @@ -4703,7 +4703,7 @@ SOFTWARE. ============================================================================== elizaOS (@elizaos/agent, @elizaos/os, @elizaos/cloud) -Version: 6693cfc62b93f9816936f3cea18f7ae97dde28a5 +Version: 524639213f03a222bf97d1c80e59f0be722da7d1 License: MIT Source: https://github.com/elizaOS/eliza.git (develop) diff --git a/apps/app/public/licenses/third-party-notices.json b/apps/app/public/licenses/third-party-notices.json index f03cba0afe..2a0e412981 100644 --- a/apps/app/public/licenses/third-party-notices.json +++ b/apps/app/public/licenses/third-party-notices.json @@ -928,7 +928,7 @@ }, { "name": "elizaOS (@elizaos/agent, @elizaos/os, @elizaos/cloud)", - "version": "6693cfc62b93f9816936f3cea18f7ae97dde28a5", + "version": "524639213f03a222bf97d1c80e59f0be722da7d1", "license": "MIT", "source": "https://github.com/elizaOS/eliza.git (develop)", "text": "MIT License\n\nCopyright (c) 2026 Shaw Walters and elizaOS Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", diff --git a/eliza.lock.json b/eliza.lock.json index ebc232478a..44f96e6363 100644 --- a/eliza.lock.json +++ b/eliza.lock.json @@ -1,5 +1,5 @@ { "remote": "https://github.com/elizaOS/eliza.git", "branch": "develop", - "commit": "6693cfc62b93f9816936f3cea18f7ae97dde28a5" + "commit": "524639213f03a222bf97d1c80e59f0be722da7d1" } From ec0957847bc7829cbf8a4a217dfb0cbde603e555 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Thu, 3 Dec 2026 08:36:02 -0500 Subject: [PATCH 09/21] Bring the two verified release-check repairs from develop to main --- vibestack/remote/test/remote.test.ts | 2 +- vibestack/util.ts | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/vibestack/remote/test/remote.test.ts b/vibestack/remote/test/remote.test.ts index 76af66860c..97b77cd7da 100644 --- a/vibestack/remote/test/remote.test.ts +++ b/vibestack/remote/test/remote.test.ts @@ -909,7 +909,7 @@ cd "${home}" && HOME="${home}" exec sh -c "$*" const client = (command: string) => { const child = spawn(process.execPath, [path.join(import.meta.dirname, "..", "cli.ts"), "exec", "vsr", "sh", "-c", command], { cwd: dir, stdio: ["ignore", "pipe", "pipe"], - env: { ...process.env, HOME: laptop, XDG_CONFIG_HOME: "", XDG_CACHE_HOME: "", VIBESTACK_REMOTE: "", PATH: `${path.join(laptop, "bin")}:${process.env.PATH}` }, + env: { ...process.env, HOME: laptop, XDG_CONFIG_HOME: "", XDG_CACHE_HOME: "", VIBESTACK_REMOTE: "", VIBESTACK_REMOTE_SIDE: "", PATH: `${path.join(laptop, "bin")}:${process.env.PATH}` }, }); const said = { out: "", err: "" }; child.stdout.on("data", (chunk: Buffer) => { said.out += chunk.toString(); }); diff --git a/vibestack/util.ts b/vibestack/util.ts index 8bf0a05f8b..95b6abf99f 100644 --- a/vibestack/util.ts +++ b/vibestack/util.ts @@ -46,7 +46,7 @@ const NAMES_CACHE_LIMIT = 2_048; const CITATIONS_CACHE_LIMIT = 4_096; const FORMAL_TOOL_REF = /(?:vibestack\/(?:src|dist|bin|formal)|@informalsystems\/quint|\blemmascript\b|\bspec\.(?:ts|js)\b|node:child_process|["']child_process["']|\bChildProcess\b)/; /** What a file is known to be while its stamp holds: its digest and lightweight boolean flags. */ -interface Stamped { stamp: string; sha: string; genImport?: boolean; hasContract?: boolean; mayRunTools?: boolean; shelled?: string[] } +interface Stamped { stamp: string; sha: string; hasContract?: boolean; mayRunTools?: boolean; shelled?: string[] } const fileDigestCache = new Map(); const namesCache = new Map(); const citationsCache = new Map(); @@ -75,7 +75,7 @@ function putDigestCache(file: string, entry: Stamped): void { putBounded(fileDigestCache, FILE_DIGEST_CACHE_LIMIT, file, entry); } -function statEntry(file: string, checkGen?: (text: string) => boolean, wantNames = false): Stamped | undefined { +function statEntry(file: string): Stamped | undefined { const stat = fs.statSync(file, { bigint: true, throwIfNoEntry: false }); if (!stat) return undefined; const at = formatStamp(stat); @@ -85,16 +85,11 @@ function statEntry(file: string, checkGen?: (text: string) => boolean, wantNames return cached; } const bytes = fs.readFileSync(file); - const text = checkGen || wantNames ? bytes.toString("utf8") : undefined; - const hasContract = bytes.includes("//@"); const entry: Stamped = { stamp: at, sha: createHash("sha256").update(bytes).digest("hex"), - hasContract, - ...(checkGen ? { genImport: checkGen(text!) } : {}), - ...(text !== undefined ? { mayRunTools: FORMAL_TOOL_REF.test(text) } : {}), + hasContract: bytes.includes("//@"), }; - if (wantNames && text !== undefined) putBounded(namesCache, NAMES_CACHE_LIMIT, file, { stamp: at, names: extractNamesFromText(text) }); putDigestCache(file, entry); return entry; } @@ -835,16 +830,14 @@ export function testInputs(root: string, mode: TestProfile = "normal", read: Inp const hash = createHash("sha256").update(JSON.stringify(["tests-v7", read, process.versions.node, process.platform, process.arch, profile(mode), ...evaluator ? [evaluator] : []])); const served = (file: string) => !isTestFile(file) && ![DRIVERS, TRACES, COUNTEREXAMPLES].some((dir) => file.startsWith(`${dir}/`)); const update = (from: string, file: string, checkGenImport: boolean): boolean => { - const full = path.join(from, file); - const hasGenImport = (text: string) => /(?:import|export|from|require)[\s\S]{0,80}gen\//.test(text) + const bytes = fs.readFileSync(path.join(from, file)); + const fileHash = createHash("sha256").update(bytes).digest("hex"); + hash.update(`${file}\0${fileHash}\0`); + if (!checkGenImport) return false; + const text = bytes.toString("utf8"); + return /(?:import|export|from|require)[\s\S]{0,80}gen\//.test(text) && tsApi().preProcessFile(text, true, true).importedFiles .some(({ fileName }) => /^\.\.?\//.test(fileName) && path.posix.join(path.posix.dirname(file), fileName).startsWith("gen/")); - const entry = statEntry(full, checkGenImport ? hasGenImport : undefined); - if (!entry) throw new Error(`ENOENT: no such file or directory, open '${full}'`); - hash.update(`${file}\0${entry.sha}\0`); - if (!checkGenImport) return false; - if (entry.genImport === undefined) entry.genImport = hasGenImport(fs.readFileSync(full, "utf8")); - return entry.genImport; }; const workspaces = workspacePackages(root); for (const { directory: from, name } of workspaces) { From 155e01c509c1d6ba84c9f138e50b071b18b7cbce Mon Sep 17 00:00:00 2001 From: Shaw Walters Date: Thu, 3 Dec 2026 06:22:11 -0800 Subject: [PATCH 10/21] Render confirm and browser review descriptions as a block, so paragraphs in them are valid HTML The app's explore stage failed on main: Settings, AI, Alpha Cloud opens a ConfirmDialog whose description holds paragraphs, and Radix renders the description as a

, so React logs that a

cannot hold a

. Render the description through a div in both dialogs that take any children. Co-Authored-By: Claude Opus 5.5 --- packages/ui/src/components/ConfirmDialog.tsx | 2 +- packages/ui/src/components/browser/BrowserReview.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/ConfirmDialog.tsx b/packages/ui/src/components/ConfirmDialog.tsx index 3ed39fbecd..cc92e29824 100644 --- a/packages/ui/src/components/ConfirmDialog.tsx +++ b/packages/ui/src/components/ConfirmDialog.tsx @@ -43,7 +43,7 @@ export function ConfirmDialog({ open, title, children, confirmLabel, cancelLabel {title} - {children ? {children} : null} + {children ?

{children}
: null}
diff --git a/packages/ui/src/components/browser/BrowserReview.tsx b/packages/ui/src/components/browser/BrowserReview.tsx index ebc25fdee4..cd7067e3b8 100644 --- a/packages/ui/src/components/browser/BrowserReview.tsx +++ b/packages/ui/src/components/browser/BrowserReview.tsx @@ -33,7 +33,7 @@ export function BrowserReview({ open, title, children, confirmLabel, cancelLabel className="fixed top-1/2 left-1/2 z-dialog flex max-h-[calc(var(--alpha-viewport-height,100dvh)_-_var(--alpha-safe-top,0px)_-_1.5rem)] w-110 max-w-[calc(100vw-1.5rem)] -translate-1/2 flex-col overflow-hidden rounded-action border border-border bg-background text-md leading-normal text-foreground outline-none">
{title} - {children ? {children} : null} + {children ?
{children}
: null}
{cancelLabel} From 60de6a6c9598cac60d4a210244100478c734922c Mon Sep 17 00:00:00 2001 From: Shaw Walters Date: Thu, 3 Dec 2026 06:47:47 -0800 Subject: [PATCH 11/21] Drop qa.run.tsx's unused openRow, which main's QA harness merge wiring left without a caller, so lint:js passes on main --- apps/app/test/eliza/qa.run.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/apps/app/test/eliza/qa.run.tsx b/apps/app/test/eliza/qa.run.tsx index 12194fa7dd..c100bef28a 100644 --- a/apps/app/test/eliza/qa.run.tsx +++ b/apps/app/test/eliza/qa.run.tsx @@ -196,21 +196,6 @@ async function startOn(alpha: Alpha, startView: string, openMail?: string): Prom /** Whether the owner can reach `element`: not hidden and not inert, as the copy under the pill is, though a dialog may keep it from assistive technology. */ const reachable = (element: Element) => element.closest("[inert], [hidden]") === null; -/** Open the row of the view in front whose name holds `words`, as the owner's tap does, once the view draws it; answer what could not be done. */ -async function openRow(words: string): Promise { - const row = () => [...document.querySelectorAll("button")].find((found) => reachable(found) && !found.disabled && named(found).includes(words)); - const found = await vi.waitFor(async () => { - await drawn(() => undefined); - const one = row(); - if (one === undefined) throw new Error(`no row reads "${words}"`); - return one; - }, { timeout: 30_000, interval: 250 }).catch(() => undefined); - if (found === undefined) return [`no row of the start view read "${words}" within 30 s`]; - await drawn(() => found.click()); - await pause(1_500); - return []; -} - /** The composer's field the owner can type in. */ const composerField = () => [...document.querySelectorAll("textarea[data-alpha-composer]")].find(reachable); From 8468173f499811b6f4e86f1cc20125e32f2e9861 Mon Sep 17 00:00:00 2001 From: Shaw Walters Date: Thu, 3 Dec 2026 06:49:06 -0800 Subject: [PATCH 12/21] Mount the map browser tests' phone-sized map once, so analyze finds no duplicate on main --- packages/ui/test/map.browser.test.tsx | 66 ++++++++++++--------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/packages/ui/test/map.browser.test.tsx b/packages/ui/test/map.browser.test.tsx index cdc07ac1f0..613fa9fb88 100644 --- a/packages/ui/test/map.browser.test.tsx +++ b/packages/ui/test/map.browser.test.tsx @@ -51,6 +51,28 @@ async function shares(element: HTMLElement): Promise<{ bare: number; coarse: num let unmount: (() => void) | undefined; afterEach(() => unmount?.()); +/** A phone-sized map drawing tiles of `style`, kept until the test ends; `show` sets its camera. */ +function mounted(style: MapViewProps["style"]) { + const host = document.createElement("div"); + host.style.cssText = "width:412px;height:915px;position:relative"; + const sized = document.createElement("style"); + sized.textContent = "[role=application]{width:412px;height:915px}"; + document.head.append(sized); + document.body.append(host); + const root = createRoot(host); + unmount = () => { act(() => root.unmount()); host.remove(); sized.remove(); }; + const show = (camera: MapCamera) => act(() => { + root.render(createElement(MapView, { + label: "Map", surface: 1, pins: [], camera, compass: () => false, zoomControls: false, className: "h-full rounded-none", + opening: { at: { lat: 0, lng: 0 }, zoom: 4 }, style, + onReady: () => undefined, onTrouble: () => undefined, onPin: () => undefined, onPress: () => undefined, onPressMove: () => undefined, + onPressEnd: () => undefined, onSettled: () => undefined, + })); + }); + show({ kind: "keep" }); + return { host, show }; +} + describe('Pan (spec/app/maps/credits.md, "Under the provider\'s map lies the same map one zoom coarser, so a part still loading shows coarser instead of blank")', () => { it("shows the coarse map while sharp tiles load", async ({ annotate }) => { const held: Held[] = []; @@ -61,28 +83,13 @@ describe('Pan (spec/app/maps/credits.md, "Under the provider\'s map lies the sam held.splice(0, held.length, ...held.filter((one) => !ready.includes(one))); return ready.length; }; - const host = document.createElement("div"); - host.style.cssText = "width:412px;height:915px;position:relative"; - const sized = document.createElement("style"); - sized.textContent = "[role=application]{width:412px;height:915px}"; - document.head.append(sized); - document.body.append(host); - const root = createRoot(host); - unmount = () => { act(() => root.unmount()); host.remove(); sized.remove(); }; - const props = (camera: MapCamera): MapViewProps => ({ - label: "Map", surface: 1, pins: [], camera, compass: () => false, zoomControls: false, className: "h-full rounded-none", - opening: { at: { lat: 0, lng: 0 }, zoom: 4 }, - style: { kind: "raster", tileSize: 256, minZoom: 0, maxZoom: 10, coarseMaxZoom: 9, coarsestMaxZoom: 8, tile: (z) => tile(z) }, - onReady: () => undefined, onTrouble: () => undefined, onPin: () => undefined, onPress: () => undefined, onPressMove: () => undefined, - onPressEnd: () => undefined, onSettled: () => undefined, - }); - act(() => { root.render(createElement(MapView, props({ kind: "keep" }))); }); + const { host, show } = mounted({ kind: "raster", tileSize: 256, minZoom: 0, maxZoom: 10, coarseMaxZoom: 9, coarsestMaxZoom: 8, tile: (z) => tile(z) }); await expect.poll(() => held.length, { timeout: 10_000 }).toBeGreaterThan(0); await expect.poll(async () => { await release([3, 4, 5]); return (await shares(host)).sharp; }, { timeout: 10_000 }).toBeGreaterThan(0.95); const floor = (await shares(host)).bare; - act(() => { root.render(createElement(MapView, props({ kind: "centre", key: "east", at: { lat: 0, lng: 15 }, zoom: 4 }))); }); + show({ kind: "centre", key: "east", at: { lat: 0, lng: 15 }, zoom: 4 }); await expect.poll(() => held.filter((one) => one.z === sharpZoom).length, { timeout: 10_000 }).toBeGreaterThan(0); const atOnce = await shares(host); const coarseAsked = await release([3, 4]); @@ -91,7 +98,7 @@ describe('Pan (spec/app/maps/credits.md, "Under the provider\'s map lies the sam const sharpOut = held.filter((one) => one.z === sharpZoom).length; await expect.poll(async () => { await release([3, 4, 5]); return (await shares(host)).sharp; }, { timeout: 10_000 }).toBeGreaterThan(0.95); - act(() => { root.render(createElement(MapView, props({ kind: "centre", key: "far", at: { lat: 0, lng: 90 }, zoom: 4 }))); }); + show({ kind: "centre", key: "far", at: { lat: 0, lng: 90 }, zoom: 4 }); await expect.poll(() => held.filter((one) => one.z === sharpZoom).length, { timeout: 10_000 }).toBeGreaterThan(0); const farAtOnce = await shares(host); const farCoarseAsked = await release([3, 4]); @@ -110,27 +117,12 @@ describe('Moving map (spec/app/maps/credits.md, "By the owner\'s choice, a movin it("asks ahead east while it moves east", async ({ annotate }) => { const asked: Array<{ z: number; x: number; y: number }> = []; const answer = solidTile(channels[5] ?? [0, 0, 255]); - const host = document.createElement("div"); - host.style.cssText = "width:412px;height:915px;position:relative"; - const sized = document.createElement("style"); - sized.textContent = "[role=application]{width:412px;height:915px}"; - document.head.append(sized); - document.body.append(host); - const root = createRoot(host); - unmount = () => { act(() => root.unmount()); host.remove(); sized.remove(); }; - const props = (camera: MapCamera): MapViewProps => ({ - label: "Map", surface: 1, pins: [], camera, compass: () => false, zoomControls: false, className: "h-full rounded-none", - opening: { at: { lat: 0, lng: 0 }, zoom: 4 }, - style: { - kind: "raster", tileSize: 256, minZoom: 0, maxZoom: 10, coarseMaxZoom: 9, coarsestMaxZoom: 8, tile: () => answer, - ahead: { frames: 20, limit: 8, tile: (z, x, y) => { asked.push({ z, x, y }); } }, - }, - onReady: () => undefined, onTrouble: () => undefined, onPin: () => undefined, onPress: () => undefined, onPressMove: () => undefined, - onPressEnd: () => undefined, onSettled: () => undefined, + const { host, show } = mounted({ + kind: "raster", tileSize: 256, minZoom: 0, maxZoom: 10, coarseMaxZoom: 9, coarsestMaxZoom: 8, tile: () => answer, + ahead: { frames: 20, limit: 8, tile: (z, x, y) => { asked.push({ z, x, y }); } }, }); - act(() => { root.render(createElement(MapView, props({ kind: "keep" }))); }); await expect.poll(async () => (await shares(host)).sharp, { timeout: 10_000 }).toBeGreaterThan(0.95); - act(() => { root.render(createElement(MapView, props({ kind: "follow", key: "east", at: { lat: 0, lng: 20 } }))); }); + show({ kind: "follow", key: "east", at: { lat: 0, lng: 20 } }); await expect.poll(() => asked.length, { timeout: 10_000 }).toBeGreaterThan(0); const startColumn = 2 ** sharpZoom / 2; await annotate(`asked ahead while moving east: ${asked.length} tiles, columns ${[...new Set(asked.map((one) => one.x))].sort((a, b) => a - b).join(",")} (the view began around column ${startColumn})`); From a2ff57fc69c755180bcced4faf3f048e8fcacc38 Mon Sep 17 00:00:00 2001 From: NubsCarson Date: Thu, 3 Dec 2026 07:06:17 -0800 Subject: [PATCH 13/21] fix(ci): stop Talk before voice-switch confirmation and clear last map jscpd clone --- apps/app/src/assistant/assistant.vibe | 12 +++++++++--- apps/app/test/ask.eliza.test.tsx | 2 +- packages/ui/test/map.browser.test.tsx | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/app/src/assistant/assistant.vibe b/apps/app/src/assistant/assistant.vibe index 66f8d402a9..bf53df4925 100644 --- a/apps/app/src/assistant/assistant.vibe +++ b/apps/app/src/assistant/assistant.vibe @@ -630,6 +630,7 @@ effect function spokenChat(session: number, turn: number, current: boolean!!): ( const now = try chats.get() return now.around === 0 && now.page.ticket === live.page.ticket && (try sourceCurrent) && (try verified) } + try Effect.provideContext(stopVoiceSwitch(session, turn), audio) fork.detached Effect.interruptible(Effect.provideContext(sayVoiceSwitch(session, turn, answer, sameChat, retired), audio)) return true }, @@ -641,6 +642,13 @@ effect function spokenChat(session: number, turn: number, current: boolean!!): ( } } +effect function stopVoiceSwitch(session: number, turn: number): void!!Voice.Machine { + const voice = try Voice.Machine + if (Voice.canSentence(try voice.get(), session, turn)) { + try contained(voice.send({ type: "stop", keyboard: false }, (state) => Voice.canSentence(state, session, turn)), "ending Talk for the voice change") + } +} + // spec/app/voice/index.md, "Talk keeps what it sends in the selected Ask Alpha conversation" effect function sayVoiceSwitch(session: number, turn: number, text: string, sameChat: boolean!!, retired: Stream.Stream): void!!(Device | VoiceBridge | VoiceWords | Voice.Machine | Speaker) { const voice = try Voice.Machine @@ -651,9 +659,7 @@ effect function sayVoiceSwitch(session: number, turn: number, text: string, same return (try sameChat) && (try device.showing()) && quiet(try voice.get()) } if (!(try sameChat) || !(try device.showing())) return - if (Voice.canSentence(try voice.get(), session, turn)) { - try contained(voice.send({ type: "stop", keyboard: false }, (state) => Voice.canSentence(state, session, turn)), "ending Talk for the voice change") - } + try stopVoiceSwitch(session, turn) const ended = Stream.runHead(Stream.filter(voice.changes, (state) => !sameTurn(state) || Voice.quiet(state))) const stopped = Effect.raceFirst(ended, Effect.as(Stream.runHead(retired), Option.none())) const result = try Effect.timeoutOption(stopped, "5 seconds") diff --git a/apps/app/test/ask.eliza.test.tsx b/apps/app/test/ask.eliza.test.tsx index 9e393c252d..57d9bff82b 100644 --- a/apps/app/test/ask.eliza.test.tsx +++ b/apps/app/test/ask.eliza.test.tsx @@ -215,7 +215,7 @@ it('Switch my AI voice from typed and spoken Ask Alpha (spec/app/assistant/index await onScreen(() => expect([...document.querySelectorAll('[role="log"] article[aria-label="Alpha"]')].at(-1)?.textContent).toMatch(/local/i)); expect(posted).toBe(1); - await until(alpha, chat, Voice, (state) => state.warmed); + await until(alpha, chat, Voice, (state) => state.route.account === "SignedOut" && state.warmed); await drawn(async () => { await chat.runPromise(Effect.flatMap(Voice, (voice) => voice.send({ type: "permissionChanged", grant: "Granted" }))); await chat.runPromise(Effect.flatMap(Voice, (voice) => voice.send({ type: "startTalking", now: untimed }))); diff --git a/packages/ui/test/map.browser.test.tsx b/packages/ui/test/map.browser.test.tsx index 613fa9fb88..92fe63c87f 100644 --- a/packages/ui/test/map.browser.test.tsx +++ b/packages/ui/test/map.browser.test.tsx @@ -51,6 +51,8 @@ async function shares(element: HTMLElement): Promise<{ bare: number; coarse: num let unmount: (() => void) | undefined; afterEach(() => unmount?.()); +const noop = () => undefined; + /** A phone-sized map drawing tiles of `style`, kept until the test ends; `show` sets its camera. */ function mounted(style: MapViewProps["style"]) { const host = document.createElement("div"); @@ -65,8 +67,8 @@ function mounted(style: MapViewProps["style"]) { root.render(createElement(MapView, { label: "Map", surface: 1, pins: [], camera, compass: () => false, zoomControls: false, className: "h-full rounded-none", opening: { at: { lat: 0, lng: 0 }, zoom: 4 }, style, - onReady: () => undefined, onTrouble: () => undefined, onPin: () => undefined, onPress: () => undefined, onPressMove: () => undefined, - onPressEnd: () => undefined, onSettled: () => undefined, + onReady: noop, onTrouble: noop, onPin: noop, onPress: noop, onPressMove: noop, + onPressEnd: noop, onSettled: noop, })); }); show({ kind: "keep" }); From 17b776ae68b6549911d5f1f0b999284d6631f519 Mon Sep 17 00:00:00 2001 From: Shaw Walters Date: Thu, 3 Dec 2026 13:26:26 -0800 Subject: [PATCH 14/21] Stop Talk for a spoken voice switch in the turn that reads it, and read its confirmation without asking the agent again Brings main's voice-switch fix (#2334) to the shape of develop's #2333, so the journey "Switch my AI voice from typed and spoken Ask Alpha" no longer drops the spoken confirmation under load and a later develop merge meets the same code. --- apps/app/src/assistant/assistant.vibe | 13 ++----------- apps/app/src/voice/voice.vibe | 1 + 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/apps/app/src/assistant/assistant.vibe b/apps/app/src/assistant/assistant.vibe index bf53df4925..5ec7de5f13 100644 --- a/apps/app/src/assistant/assistant.vibe +++ b/apps/app/src/assistant/assistant.vibe @@ -628,9 +628,8 @@ effect function spokenChat(session: number, turn: number, current: boolean!!): ( if (!readAfterSwitch) return false const sameChat = effect { const now = try chats.get() - return now.around === 0 && now.page.ticket === live.page.ticket && (try sourceCurrent) && (try verified) + return now.around === 0 && now.page.ticket === live.page.ticket && (try sourceCurrent) && (try selected) } - try Effect.provideContext(stopVoiceSwitch(session, turn), audio) fork.detached Effect.interruptible(Effect.provideContext(sayVoiceSwitch(session, turn, answer, sameChat, retired), audio)) return true }, @@ -642,13 +641,6 @@ effect function spokenChat(session: number, turn: number, current: boolean!!): ( } } -effect function stopVoiceSwitch(session: number, turn: number): void!!Voice.Machine { - const voice = try Voice.Machine - if (Voice.canSentence(try voice.get(), session, turn)) { - try contained(voice.send({ type: "stop", keyboard: false }, (state) => Voice.canSentence(state, session, turn)), "ending Talk for the voice change") - } -} - // spec/app/voice/index.md, "Talk keeps what it sends in the selected Ask Alpha conversation" effect function sayVoiceSwitch(session: number, turn: number, text: string, sameChat: boolean!!, retired: Stream.Stream): void!!(Device | VoiceBridge | VoiceWords | Voice.Machine | Speaker) { const voice = try Voice.Machine @@ -659,8 +651,7 @@ effect function sayVoiceSwitch(session: number, turn: number, text: string, same return (try sameChat) && (try device.showing()) && quiet(try voice.get()) } if (!(try sameChat) || !(try device.showing())) return - try stopVoiceSwitch(session, turn) - const ended = Stream.runHead(Stream.filter(voice.changes, (state) => !sameTurn(state) || Voice.quiet(state))) + const ended = Stream.runHead(Stream.filter(voice.changes, (state) => !sameTurn(state) || state.phase === "Failed" || quiet(state))) const stopped = Effect.raceFirst(ended, Effect.as(Stream.runHead(retired), Option.none())) const result = try Effect.timeoutOption(stopped, "5 seconds") if (Option.isNone(result) || Option.isNone(result.value) || !quiet(result.value.value)) return diff --git a/apps/app/src/voice/voice.vibe b/apps/app/src/voice/voice.vibe index 9577e543f7..bb42021842 100644 --- a/apps/app/src/voice/voice.vibe +++ b/apps/app/src/voice/voice.vibe @@ -736,6 +736,7 @@ effect function spokenCommand({ session, turn, queue, lease, spoken }: VoicePost const { text, reading } = try Effect.uninterruptible(effect { const { text, changed } = try executeVoiceModeCommand(mode, current) const reading = try lease.settleCommand(spoken, text, sourceCurrent, changed && canReadAfterSwitch) + if (reading) try contained(voice.send({ type: "stop", keyboard: false }, (state) => Voice.canSentence(state, session, turn)), "ending Talk for the voice change") return { text, reading } }) if (reading || !(try current)) return undefined From 255b9b4affb109f48031830def0e3e14f8c72965 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 02:38:09 -0500 Subject: [PATCH 15/21] Make develop's checks pass again after today's merges - image.test.ts calls published_artifact_record with the artifact name its new signature requires; the producer names both artifacts once - surface.test.tsx admits the assistant/* overlay mounts develop added; reminders.test.tsx waits for the complete attempt to settle before asserting its POST - cli.test.ts parses the receipt artifact JSON as unknown instead of any - approvals-voice, honest-ask-first and voice-universal-approvals share their setup through test/review-support.tsx, and voice.test.tsx reuses its own helper, so jscpd finds no clones - MessageItem's avatar button and the Inbox add-account chip carry their names as their own text; Startup Access upcoming rows keep a readable status contrast --- apps/app/test/approvals-voice.test.tsx | 90 ++-------------- apps/app/test/honest-ask-first.test.tsx | 64 +---------- apps/app/test/image.test.ts | 12 +-- apps/app/test/reminders.test.tsx | 2 +- apps/app/test/review-support.tsx | 101 ++++++++++++++++++ apps/app/test/surface.test.tsx | 2 +- .../test/voice-universal-approvals.test.tsx | 49 ++------- apps/app/test/voice.test.tsx | 33 +++--- packages/cli/test/cli.test.ts | 7 +- .../src/components/inbox/InboxListScreen.tsx | 2 +- .../src/components/messaging/MessageItem.tsx | 4 +- .../components/startup/StartupAccessRow.tsx | 4 +- scripts/ci/app_update_producer.py | 6 +- 13 files changed, 155 insertions(+), 221 deletions(-) create mode 100644 apps/app/test/review-support.tsx diff --git a/apps/app/test/approvals-voice.test.tsx b/apps/app/test/approvals-voice.test.tsx index 3be6c10127..feb1b41282 100644 --- a/apps/app/test/approvals-voice.test.tsx +++ b/apps/app/test/approvals-voice.test.tsx @@ -5,58 +5,30 @@ // spec/app/phone/index.md, "The agent reads the newest calls of the window the owner asked about, and only missed ones when asked" // spec/app/messages/index.md, "The agent reads only the recent texts the owner asked about, and changes nothing" // spec/app/voice/index.md, "A reply that needs the owner's review in chat keeps voice listening with the microphone open" -import { act } from "react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { Effect } from "effect"; -import { Machine as Composer } from "../gen/app__assistant__composer.effect.vibe"; import { Machine as Conversation } from "../gen/app__assistant.effect.vibe"; import { Machine as Messages } from "../gen/app__messages.effect.vibe"; import { Machine as Phone } from "../gen/app__phone.effect.vibe"; import * as Prefs from "../gen/app__settings__preferences.effect.vibe"; import * as Shell from "../gen/app__shell.effect.vibe"; import * as Voice from "../gen/app__voice.effect.vibe"; -import assistant from "../src/assistant/index.tsx"; -import type { Alpha } from "../src/runtime/area.tsx"; -import { untimed } from "../src/runtime/reactor.vibe"; -import * as From from "../src/runtime/senders.auth.vibe"; -import { closeAll, drawn, later, only, open, press, typeInto, underAct, until } from "./alpha.tsx"; +import { closeAll, drawn, later, only, press, underAct, until } from "./alpha.tsx"; import { prepared } from "./fakes/notes.ts"; import { scene, type Scene } from "./fakes/scene.ts"; import { alsoPending, textReview, type TextReviewScene } from "./fakes/text-review.ts"; +import { approveButtons, bindDirect, directProposal, lastOwnerTurn, openAssistant, reviewProposal, sendTyped, speak, startVoice } from "./review-support.tsx"; underAct(); afterEach(closeAll); const mounts = only("home", "assistant", "view:Settings", "view:Messages", "view:Notes", "view:Phone", "notice"); -const directProposal = (proposalId: string) => ({ - action: "PROPOSE_DEVICE_ACTION", - data: { proposalId, state: "pending", executed: false, approvalRequired: false, awaitingDeviceExecution: true, directRequest: true }, -}); - -const reviewProposal = (proposalId: string) => ({ - action: "PROPOSE_DEVICE_ACTION", - data: { proposalId, state: "pending", executed: false, approvalRequired: true, awaitingUserInput: true }, -}); - -function lastOwnerTurn(world: Scene) { - const chat = [...world.ask.kept].at(-1); - const owner = chat?.[1].messages.at(-1); - if (!chat || owner?.role !== "user" || typeof owner.clientMessageId !== "string") { - throw new Error("The fake resident did not retain the owner turn"); - } - return { conversationId: chat[0], messageId: owner.id, requestId: owner.clientMessageId }; -} - -function bindDirect(world: Scene, review: TextReviewScene) { - review.proposal.payload.requestMessageId = lastOwnerTurn(world).messageId; - return [directProposal(review.proposal.id)]; -} - function bindDirectRead(world: Scene, review: TextReviewScene) { - const turn = lastOwnerTurn(world); - review.proposal.payload.requestMessageId = turn.messageId; - review.readOrigin = { version: 1, requestId: turn.requestId, conversationId: turn.conversationId, inReplyTo: turn.messageId }; + const { conversationId, messageId, requestId } = lastOwnerTurn(world); + if (requestId === undefined) throw new Error("Alpha sent the owner turn without its request id"); + review.proposal.payload.requestMessageId = messageId; + review.readOrigin = { version: 1, requestId, conversationId, inReplyTo: messageId }; return [directProposal(review.proposal.id)]; } @@ -69,56 +41,8 @@ function nextProposal(review: TextReviewScene, id: string, operation: TextReview review.others.length = 0; } -async function setAskFirst(alpha: Alpha, askFirst: boolean) { - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.document.read.status === "Loaded"); - const current = await alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.get())); - if (current.askFirst !== askFirst) { - await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.send({ type: "setAskFirst", askFirst, at: untimed }, From.owner)))); - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.askFirst === askFirst); - } -} - -async function bootApp(world: Scene, askFirst: boolean, sheet = true) { - const { alpha, close } = await open(world, mounts); - const area = assistant.runtime(alpha); - await until(alpha, area, Composer, (s) => s.slot === "Open"); - await until(alpha, area, Conversation, (s) => s.ready && s.observing); - await until(alpha, alpha.runtime, Shell.Machine, (s) => s.image); - await setAskFirst(alpha, askFirst); - if (sheet) { - await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Shell.Machine, (m) => m.send({ type: "raise", detent: "Sheet" })))); - await until(alpha, alpha.runtime, Shell.Machine, (s) => s.assistant === "Sheet"); - } - return { alpha, area, close }; -} - -async function sendTyped(alpha: Alpha, area: ReturnType, text: string) { - await drawn(() => vi.waitFor(() => expect(document.querySelector("textarea[aria-label='Message Alpha']")).not.toBeNull())); - act(() => { - const box = document.querySelector("textarea[aria-label='Message Alpha']"); - if (!box) throw new Error("no composer"); - typeInto(box, text); - }); - await until(alpha, area, Composer, (s) => s.draft.sync === "Kept"); - await press("Send"); - await until(alpha, area, Conversation, (s) => s.turn.reply === "Complete"); -} - -async function startVoice(alpha: Alpha, area: ReturnType) { - await until(alpha, area, Voice.Machine, (s) => s.warmed); - await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "permissionChanged", grant: "Granted" })))); - await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "startTalking", now: untimed })))); - await until(alpha, area, Voice.Machine, (s) => s.phase === "Listening" && s.mic === "On"); -} - -function speak(world: Scene, text: string) { - world.voice.emitLocal?.("liveCaptureTranscript", { - captureId: world.voice.activeMicSession, - final: { turnId: `turn-${world.ask.said.length + 1}`, text, mode: "device" }, - }); -} +const bootApp = (world: Scene, askFirst: boolean, sheet = true) => openAssistant(world, mounts, { askFirst, sheet }); -const approveButtons = () => [...document.querySelectorAll("button")].filter((one) => one.textContent === "Approve"); const declineButtons = () => [...document.querySelectorAll("button")].filter((one) => one.textContent === "Decline"); describe("Approvals mode, Legible text consequence, compound reviews, and Voice reads", () => { diff --git a/apps/app/test/honest-ask-first.test.tsx b/apps/app/test/honest-ask-first.test.tsx index 26181f7a12..c6acb42f62 100644 --- a/apps/app/test/honest-ask-first.test.tsx +++ b/apps/app/test/honest-ask-first.test.tsx @@ -2,84 +2,28 @@ // spec/app/settings/preferences.md, "Ask before Alpha acts covers the agent's actions on the web, with the camera, in Photos and Files, its reading of the latest texter's number and its text drafts" // spec/app/browser/reading.md, "Story: Review an excerpt to ask about" // spec/app/notes/voice.md, "Story: Read and use the transcript" -import { act } from "react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { Effect } from "effect"; import { Machine as BrowserTabs } from "../gen/app__browser.effect.vibe"; -import { Machine as Composer } from "../gen/app__assistant__composer.effect.vibe"; -import { Machine as Conversation } from "../gen/app__assistant.effect.vibe"; import { Machine as NotesList } from "../gen/app__notes.effect.vibe"; import { Machine as NotesVoice } from "../gen/app__notes__voice.effect.vibe"; import * as Prefs from "../gen/app__settings__preferences.effect.vibe"; import * as Shell from "../gen/app__shell.effect.vibe"; -import assistant from "../src/assistant/index.tsx"; import browser from "../src/browser/index.tsx"; import { decodeReadingOverlay } from "../src/browser/reading.vibe"; import notes from "../src/notes/index.tsx"; -import type { Alpha } from "../src/runtime/area.tsx"; -import { untimed } from "../src/runtime/reactor.vibe"; -import * as From from "../src/runtime/senders.auth.vibe"; -import { closeAll, drawn, later, only, open, press, typeInto, underAct, until } from "./alpha.tsx"; +import { closeAll, drawn, later, only, open, press, underAct, until } from "./alpha.tsx"; import { note } from "./fakes/notes.ts"; import { scene, type Scene } from "./fakes/scene.ts"; -import { textReview, type TextReviewScene } from "./fakes/text-review.ts"; +import { textReview } from "./fakes/text-review.ts"; +import { approveButtons, bindDirect, openAssistant, sendTyped, setAskFirst } from "./review-support.tsx"; underAct(); afterEach(closeAll); const mounts = only("home", "assistant", "view:Settings", "view:Messages", "view:Notes", "view:Phone", "notice"); -const directProposal = (proposalId: string) => ({ - action: "PROPOSE_DEVICE_ACTION", - data: { proposalId, state: "pending", executed: false, approvalRequired: false, awaitingDeviceExecution: true, directRequest: true }, -}); - -function lastOwnerTurn(world: Scene) { - const chat = [...world.ask.kept].at(-1); - const owner = chat?.[1].messages.at(-1); - if (!chat || owner?.role !== "user") throw new Error("Missing retained owner turn"); - return owner.id; -} - -function bindDirect(world: Scene, review: TextReviewScene) { - review.proposal.payload.requestMessageId = lastOwnerTurn(world); - return [directProposal(review.proposal.id)]; -} - -async function setAskFirst(alpha: Alpha, askFirst: boolean) { - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.document.read.status === "Loaded"); - const current = await alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.get())); - if (current.askFirst !== askFirst) { - await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.send({ type: "setAskFirst", askFirst, at: untimed }, From.owner)))); - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.askFirst === askFirst); - } -} - -async function bootAssistant(world: Scene, askFirst: boolean) { - const { alpha, close } = await open(world, mounts); - const area = assistant.runtime(alpha); - await until(alpha, area, Composer, (s) => s.slot === "Open"); - await until(alpha, area, Conversation, (s) => s.ready && s.observing); - await until(alpha, alpha.runtime, Shell.Machine, (s) => s.image); - await setAskFirst(alpha, askFirst); - await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Shell.Machine, (m) => m.send({ type: "raise", detent: "Sheet" })))); - await until(alpha, alpha.runtime, Shell.Machine, (s) => s.assistant === "Sheet"); - return { alpha, area, close }; -} - -async function sendTyped(alpha: Alpha, area: ReturnType, text: string) { - await drawn(() => vi.waitFor(() => expect(document.querySelector("textarea[aria-label='Message Alpha']")).not.toBeNull())); - act(() => { - const box = document.querySelector("textarea[aria-label='Message Alpha']"); - if (!box) throw new Error("Missing composer"); - typeInto(box, text); - }); - await until(alpha, area, Composer, (s) => s.draft.sync === "Kept"); - await press("Send"); - await until(alpha, area, Conversation, (s) => s.turn.reply === "Complete"); -} - -const approveButtons = () => [...document.querySelectorAll("button")].filter((one) => one.textContent === "Approve"); +const bootAssistant = (world: Scene, askFirst: boolean) => openAssistant(world, mounts, { askFirst, sheet: true }); describe("Honest Ask before Alpha acts, Notes transcript Sheet, and BrowserReadingSheet", () => { it("keeps Ask before Alpha acts OFF by default and propagates askBeforeActing only when ON", async () => { diff --git a/apps/app/test/image.test.ts b/apps/app/test/image.test.ts index c8ad4f21b8..8db4f50ed7 100644 --- a/apps/app/test/image.test.ts +++ b/apps/app/test/image.test.ts @@ -523,28 +523,28 @@ logs = {prefix + "6/logs": downloaded, prefix + "11/logs": ledger} def github(args, **options): return subprocess.CompletedProcess(args, 0, stdout=logs[args[-1]].encode("utf-8-sig")) with patch("subprocess.run", side_effect=github): - assert producer.published_artifact_record(job, "download") == ("42", "2", "70", digest) - assert producer.published_artifact_record(job, "upload") == ("71",) + assert producer.published_artifact_record(job, "download", producer.RELEASE_DELIVERY_ARTIFACT) == ("42", "2", "70", digest) + assert producer.published_artifact_record(job, "upload", producer.RELEASE_LEDGER_ARTIFACT) == ("71",) for bad_upload in (delivery, ledger + "\r\n" + ledger): logs[prefix + "11/logs"] = bad_upload - try: producer.published_artifact_record(job, "upload") + try: producer.published_artifact_record(job, "upload", producer.RELEASE_LEDGER_ARTIFACT) except ValueError: pass else: raise AssertionError("Invalid original publication ledger admitted") for bad_download in (delivery, downloaded[:-1] + "b", downloaded + "\r\n" + measured): logs[prefix + "6/logs"] = bad_download - try: producer.published_artifact_record(job, "download") + try: producer.published_artifact_record(job, "download", producer.RELEASE_DELIVERY_ARTIFACT) except ValueError: pass else: raise AssertionError("Unverified original publication delivery admitted") siblings = {**job, "steps": [*job["steps"], step(15, "download", "success")]} for first, second in ((delivery, measured), (delivery, downloaded), (downloaded, downloaded)): logs[prefix + "6/logs"] = first logs[prefix + "15/logs"] = second - try: producer.published_artifact_record(siblings, "download") + try: producer.published_artifact_record(siblings, "download", producer.RELEASE_DELIVERY_ARTIFACT) except ValueError: pass else: raise AssertionError("Split or competing download evidence admitted") logs[prefix + "6/logs"] = downloaded logs[prefix + "15/logs"] = stamp + "- unrelated (ID: 72, Size: 1)" + "\r\n" + measured[:-1] + "b" - assert producer.published_artifact_record(siblings, "download") == ("42", "2", "70", digest) + assert producer.published_artifact_record(siblings, "download", producer.RELEASE_DELIVERY_ARTIFACT) == ("42", "2", "70", digest) `], { cwd: place("../..") }); const delayed = delivered(141); const previous = channel.assets["alpha-update-stable.json"]; diff --git a/apps/app/test/reminders.test.tsx b/apps/app/test/reminders.test.tsx index f890493e5f..481024273d 100644 --- a/apps/app/test/reminders.test.tsx +++ b/apps/app/test/reminders.test.tsx @@ -633,7 +633,7 @@ describe("Reminders full journeys", () => { await later(alpha, 10 * 60_000 + 1_000); await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId > 0); await press("Complete"); - await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId === 0); + await until(alpha, runtime, AlertsMachine.Machine, (s) => s.bannerId === 0 && s.entries.every((entry) => entry.attempt.outcome !== "Sent")); expect(storeView().snapshot.items.find((i) => i.id === item!.id)?.completed).toBe(true); expect(recorder.calls.some((c) => c.method === "POST" && c.path.endsWith("/complete") && c.body.item !== undefined)).toBe(true); diff --git a/apps/app/test/review-support.tsx b/apps/app/test/review-support.tsx new file mode 100644 index 0000000000..40b70da1f9 --- /dev/null +++ b/apps/app/test/review-support.tsx @@ -0,0 +1,101 @@ +import { Effect } from "effect"; +import { act } from "react"; +import { expect, vi } from "vitest"; +import { Machine as Composer } from "../gen/app__assistant__composer.effect.vibe"; +import { Machine as Conversation } from "../gen/app__assistant.effect.vibe"; +import * as Prefs from "../gen/app__settings__preferences.effect.vibe"; +import * as Shell from "../gen/app__shell.effect.vibe"; +import * as Voice from "../gen/app__voice.effect.vibe"; +import type { Mount } from "../src/areas.ts"; +import assistant from "../src/assistant/index.tsx"; +import type { Alpha } from "../src/runtime/area.tsx"; +import { untimed } from "../src/runtime/reactor.vibe"; +import * as From from "../src/runtime/senders.auth.vibe"; +import { drawn, open, press, typeInto, until } from "./alpha.tsx"; +import type { Scene } from "./fakes/scene.ts"; +import type { TextReviewScene } from "./fakes/text-review.ts"; + +type Area = ReturnType; + +/** The agent's proposal of a device action the owner asked for in so many words, which runs without a review. */ +export const directProposal = (proposalId: string) => ({ + action: "PROPOSE_DEVICE_ACTION", + data: { proposalId, state: "pending", executed: false, approvalRequired: false, awaitingDeviceExecution: true, directRequest: true }, +}); + +/** The agent's proposal of a device action that waits for the owner's review in chat. */ +export const reviewProposal = (proposalId: string) => ({ + action: "PROPOSE_DEVICE_ACTION", + data: { proposalId, state: "pending", executed: false, approvalRequired: true, awaitingUserInput: true }, +}); + +/** The owner's turn the fake resident kept last: its conversation, its message and the request id Alpha sent it with. */ +export function lastOwnerTurn(world: Scene) { + const chat = [...world.ask.kept].at(-1); + const owner = chat?.[1].messages.at(-1); + if (!chat || owner?.role !== "user") throw new Error("The fake resident did not retain the owner turn"); + return { conversationId: chat[0], messageId: owner.id, requestId: owner.clientMessageId }; +} + +/** Tie `review`'s proposal to the owner's last turn and propose it as asked for directly. */ +export function bindDirect(world: Scene, review: TextReviewScene) { + review.proposal.payload.requestMessageId = lastOwnerTurn(world).messageId; + return [directProposal(review.proposal.id)]; +} + +/** Turn Ask before Alpha acts to `askFirst`, as the owner does in Settings, once the preferences are read. */ +export async function setAskFirst(alpha: Alpha, askFirst: boolean) { + await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.document.read.status === "Loaded"); + const current = await alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.get())); + if (current.askFirst !== askFirst) { + await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.send({ type: "setAskFirst", askFirst, at: untimed }, From.owner)))); + await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.askFirst === askFirst); + } +} + +/** Open Alpha over `world` with Ask Alpha ready and Ask before Alpha acts at `askFirst`, raised to its Sheet when `sheet`. */ +export async function openAssistant(world: Scene, mounts: readonly Mount[], { askFirst, sheet }: { readonly askFirst: boolean; readonly sheet: boolean }) { + const { alpha, close } = await open(world, mounts); + const area = assistant.runtime(alpha); + await until(alpha, area, Composer, (s) => s.slot === "Open"); + await until(alpha, area, Conversation, (s) => s.ready && s.observing); + await until(alpha, alpha.runtime, Shell.Machine, (s) => s.image); + await setAskFirst(alpha, askFirst); + if (sheet) { + await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Shell.Machine, (m) => m.send({ type: "raise", detent: "Sheet" })))); + await until(alpha, alpha.runtime, Shell.Machine, (s) => s.assistant === "Sheet"); + } + return { alpha, area, close }; +} + +/** Type `text` into Ask Alpha's composer, send it and wait for the reply to complete. */ +export async function sendTyped(alpha: Alpha, area: Area, text: string) { + await drawn(() => vi.waitFor(() => expect(document.querySelector("textarea[aria-label='Message Alpha']")).not.toBeNull())); + act(() => { + const box = document.querySelector("textarea[aria-label='Message Alpha']"); + if (!box) throw new Error("no composer"); + typeInto(box, text); + }); + await until(alpha, area, Composer, (s) => s.draft.sync === "Kept"); + await press("Send"); + await until(alpha, area, Conversation, (s) => s.turn.reply === "Complete"); +} + +/** Grant the microphone and start Talk, waiting until voice listens with the microphone on. */ +export async function startVoice(alpha: Alpha, area: Area) { + await until(alpha, area, Voice.Machine, (s) => s.warmed); + await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "permissionChanged", grant: "Granted" })))); + await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "startTalking", now: untimed })))); + await until(alpha, area, Voice.Machine, (s) => s.phase === "Listening" && s.mic === "On"); +} + +/** The owner says `text`, as the phone's live capture hears it in a final transcript. */ +export function speak(world: Scene, text: string) { + world.voice.emitLocal?.("liveCaptureTranscript", { + captureId: world.voice.activeMicSession, + final: { turnId: `turn-${world.ask.said.length + 1}`, text, mode: "device" }, + }); +} + +/** Every Approve button drawn. */ +export const approveButtons = () => [...document.querySelectorAll("button")].filter((one) => one.textContent === "Approve"); diff --git a/apps/app/test/surface.test.tsx b/apps/app/test/surface.test.tsx index 05e080159c..f2b035b223 100644 --- a/apps/app/test/surface.test.tsx +++ b/apps/app/test/surface.test.tsx @@ -85,7 +85,7 @@ describe("Multi-surface parser, mount filtering, OCR gating, and lock scoping", expect(lockNameFor(overlay)).toBe("alpha.page:overlay"); expect(needsLocalOcr(overlay)).toBe(false); const overlayPlaces = mountsFor(overlay, mounts).map((entry) => entry.at); - expect(overlayPlaces.every((place) => place === "assistant" || place === "assistant/calendar" || place === "overlay" || place === "notice")).toBe(true); + expect(overlayPlaces.every((place) => place === "assistant" || place.startsWith("assistant/") || place === "overlay" || place === "notice")).toBe(true); expect(overlayPlaces).toContain("assistant"); expect(overlayPlaces).toContain("notice"); expect(overlayPlaces).not.toContain("home"); diff --git a/apps/app/test/voice-universal-approvals.test.tsx b/apps/app/test/voice-universal-approvals.test.tsx index 6c566034b9..428eca518e 100644 --- a/apps/app/test/voice-universal-approvals.test.tsx +++ b/apps/app/test/voice-universal-approvals.test.tsx @@ -3,9 +3,6 @@ // spec/app/contacts/agent.md, "Only the owner approves, only what is shown as it is now, and only when the phone has ruled out an emergency call" import { afterEach, describe, expect, it, vi } from "vitest"; import { Effect } from "effect"; -import { Machine as Composer } from "../gen/app__assistant__composer.effect.vibe"; -import { Machine as Conversation } from "../gen/app__assistant.effect.vibe"; -import * as Prefs from "../gen/app__settings__preferences.effect.vibe"; import * as Shell from "../gen/app__shell.effect.vibe"; import * as Voice from "../gen/app__voice.effect.vibe"; import assistant from "../src/assistant/index.tsx"; @@ -19,11 +16,10 @@ import { Talk } from "../src/assistant/talk.vibe"; import { CalendarReviews } from "../src/calendar/reviews.vibe"; import { SlackDesk } from "../src/slack/desk.vibe"; import { TelegramDesk } from "../src/telegram/desk.vibe"; -import { untimed } from "../src/runtime/reactor.vibe"; -import * as From from "../src/runtime/senders.auth.vibe"; import { closeAll, drawn, later, only, open, underAct, until } from "./alpha.tsx"; import { scene, type Scene } from "./fakes/scene.ts"; import { textReview, type TextReviewScene } from "./fakes/text-review.ts"; +import { openAssistant, reviewProposal, speak, startVoice } from "./review-support.tsx"; underAct(); afterEach(closeAll); @@ -43,11 +39,6 @@ const mounts = only( "notice", ); -const kept = (proposalId: string) => ({ - action: "PROPOSE_DEVICE_ACTION", - data: { proposalId, state: "pending", executed: false, approvalRequired: true, awaitingUserInput: true }, -}); - const decide = (reviewId: string, decision: "approve" | "decline" | "choose", choiceIndex?: number) => ({ action: "DECIDE_PENDING_REVIEW", data: { reviewId, decision, ...(choiceIndex === undefined ? {} : { choiceIndex }) }, @@ -56,13 +47,6 @@ const decide = (reviewId: string, decision: "approve" | "decline" | "choose", ch const button = (label: string) => [...document.querySelectorAll("button")].find((one) => one.getAttribute("aria-label") === label || one.textContent === label); -function speak(world: Scene, text: string) { - world.voice.emitLocal?.("liveCaptureTranscript", { - captureId: world.voice.activeMicSession, - final: { turnId: `turn-${world.ask.said.length + 1}`, text, mode: "device" }, - }); -} - function pendingReviewsOf(world: Scene): readonly PendingReviewSummary[] | undefined { const latest = world.ask.metadata?.at(-1) as { readonly pendingReviews?: readonly PendingReviewSummary[] } | undefined; return latest?.pendingReviews; @@ -70,24 +54,9 @@ function pendingReviewsOf(world: Scene): readonly PendingReviewSummary[] | undef async function bootCompactTalk(world: Scene, askFirst = false) { world.ask.metadata = []; - const { alpha, close } = await open(world, mounts); - const area = assistant.runtime(alpha); - await until(alpha, area, Composer, (s) => s.slot === "Open"); - await until(alpha, area, Conversation, (s) => s.ready && s.observing); - await until(alpha, alpha.runtime, Shell.Machine, (s) => s.image); - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.document.read.status === "Loaded"); - if (askFirst) { - const current = await alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.get())); - if (!current.askFirst) { - await drawn(() => alpha.runtime.runPromise(Effect.flatMap(Prefs.Machine, (m) => m.send({ type: "setAskFirst", askFirst: true, at: untimed }, From.owner)))); - await until(alpha, alpha.runtime, Prefs.Machine, (s) => s.askFirst); - } - } - await until(alpha, area, Voice.Machine, (s) => s.warmed); - await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "permissionChanged", grant: "Granted" })))); - await drawn(() => area.runPromise(Effect.flatMap(Voice.Machine, (m) => m.send({ type: "startTalking", now: untimed })))); - await until(alpha, area, Voice.Machine, (s) => s.phase === "Listening" && s.mic === "On"); - return { alpha, area, close }; + const opened = await openAssistant(world, mounts, { askFirst, sheet: false }); + await startVoice(opened.alpha, opened.area); + return opened; } async function autoConfirmSms(review: TextReviewScene) { @@ -129,7 +98,7 @@ describe("Universal Voice Approvals across all inline embeds (Q5)", () => { const { alpha, area } = await bootCompactTalk(world); await expectAssistantDetent(alpha, "Bar"); - await speakAndAwaitReview(world, alpha, area, "Review the text to Maya.", () => [kept("home-sms-1")], "Text Maya to meet upstairs.", 1); + await speakAndAwaitReview(world, alpha, area, "Review the text to Maya.", () => [reviewProposal("home-sms-1")], "Text Maya to meet upstairs.", 1); expect(button("Send this text")).toBeDefined(); expect(document.body.textContent).toContain("Meet upstairs."); @@ -157,7 +126,7 @@ describe("Universal Voice Approvals across all inline embeds (Q5)", () => { const { alpha, area } = await bootCompactTalk(world); world.ask.nextReplyChunks = ["Review the text."]; - world.ask.nextActions = () => [kept("home-sms-decline")]; + world.ask.nextActions = () => [reviewProposal("home-sms-decline")]; await drawn(() => speak(world, "Text Maya to cancel dinner.")); await until(alpha, area, Voice.Machine, (s) => s.sent === 1 && s.reviewPending && s.phase === "Listening"); @@ -181,7 +150,7 @@ describe("Universal Voice Approvals across all inline embeds (Q5)", () => { const { alpha, area } = await bootCompactTalk(world); world.ask.nextReplyChunks = ["Sent!"]; - world.ask.nextActions = () => [kept("sneaky-same-turn"), decide("media:sneaky-same-turn", "approve")]; + world.ask.nextActions = () => [reviewProposal("sneaky-same-turn"), decide("media:sneaky-same-turn", "approve")]; await drawn(() => speak(world, "Text Maya right now.")); await until(alpha, area, Voice.Machine, (s) => s.sent === 1 && s.reviewPending && s.phase === "Listening"); await later(alpha, 300); @@ -250,7 +219,7 @@ describe("Universal Voice Approvals across all inline embeds (Q5)", () => { expect((await alpha.runtime.runPromise(Effect.flatMap(Shell.Machine, (m) => m.get()))).assistant).toBe("Bar"); world.ask.nextReplyChunks = ["Ready to open alphacompute.ai."]; - world.ask.nextActions = () => [kept("spoken-browser-1")]; + world.ask.nextActions = () => [reviewProposal("spoken-browser-1")]; await drawn(() => speak(world, "Open alphacompute.ai.")); await vi.waitFor(async () => expect((await alpha.runtime.runPromise(Effect.flatMap(Shell.Machine, (m) => m.get()))).assistant).toBe("Sheet"), { timeout: 3000 }); await vi.waitFor(async () => { @@ -282,7 +251,7 @@ describe("Universal Voice Approvals across all inline embeds (Q5)", () => { const { alpha, area } = await bootCompactTalk(world); world.ask.nextReplyChunks = ["Pick a number for Maya."]; - world.ask.nextActions = () => [kept("multi-sms")]; + world.ask.nextActions = () => [reviewProposal("multi-sms")]; await drawn(() => speak(world, "Text Maya see you soon.")); await until(alpha, alpha.runtime, Shell.Machine, (s) => s.assistant === "Sheet"); await until(alpha, area, Voice.Machine, (s) => s.sent === 1 && s.reviewPending && s.phase === "Listening"); diff --git a/apps/app/test/voice.test.tsx b/apps/app/test/voice.test.tsx index 8fe92e5df9..62f65e3235 100644 --- a/apps/app/test/voice.test.tsx +++ b/apps/app/test/voice.test.tsx @@ -1993,35 +1993,31 @@ describe("Talk from Ask Alpha's composer (spec/app/voice/index.md, \"Story: Hold await drawnUntil(alpha, area, Voice.Machine, (s) => s.phase === "Idle"); } - async function expectAnsweredThenEnded( - alpha: Awaited>["alpha"], - area: Awaited>["area"], - world: Awaited>["world"], - state: Awaited>["state"], - asked: string, - ) { - expect([(await state()).ending, (await state()).sent, world.ask.said]).toEqual([true, 0, []]); - expect(button("Microphone off")?.getAttribute("aria-pressed")).toBe("true"); - await later(alpha, CLOUD_TURN_GAP_MS); - await drawnUntil(alpha, area, Voice.Machine, (s) => s.phase === "Idle"); - const ended = await state(); - expect([ended.sent, ended.ending, ended.mic, world.ask.said]).toEqual([1, false, "Off", [asked]]); + async function answeredThenEnded(talk: Awaited>, asked: string) { + await later(talk.alpha, CLOUD_TURN_GAP_MS); + await drawnUntil(talk.alpha, talk.area, Voice.Machine, (s) => s.phase === "Idle"); + const ended = await talk.state(); + expect([ended.sent, ended.ending, ended.mic, talk.world.ask.said]).toEqual([1, false, "Off", [asked]]); } // spec/app/voice/index.md, "When the owner finishes speaking, the microphone closes, and only then is the turn sent, once and automatically"; spec/app/voice/index.md, "Stop while the owner is speaking still sends what they said, Alpha answers it, and then Talk ends" it("over the Cloud relay, Stop within the gap still sends the finished sentence, Alpha answers it, and Talk then ends", async () => { - const { world, alpha, area, state, heard } = await startCloudTalk(); + const talk = await startCloudTalk(); + const { world, alpha, area, state, heard } = talk; const asked = "What is on my calendar tomorrow?"; await heard(asked); await later(alpha, 200); await press("Stop voice conversation"); await drawnUntil(alpha, area, Voice.Machine, (s) => s.ending && s.mic === "Off" && s.phase === "Listening"); - await expectAnsweredThenEnded(alpha, area, world, state, asked); + expect([(await state()).ending, (await state()).sent, world.ask.said]).toEqual([true, 0, []]); + expect(button("Microphone off")?.getAttribute("aria-pressed")).toBe("true"); + await answeredThenEnded(talk, asked); }); // spec/app/voice/index.md, "When the owner finishes speaking, the microphone closes, and only then is the turn sent, once and automatically"; spec/app/voice/index.md, "Stop while the owner is speaking still sends what they said, Alpha answers it, and then Talk ends" it("over the Cloud relay, Stop pressed while the owner is still speaking sends what they said once the relay's final arrives, and Talk then ends", async () => { - const { world, alpha, area, sessionId, state } = await startCloudTalk(); + const talk = await startCloudTalk(); + const { world, alpha, area, sessionId, state } = talk; const asked = "What is on my calendar tomorrow?"; await drawn(() => world.voice.emitCloud?.({ type: "speech-start", sessionId })); await drawnUntil(alpha, area, Voice.Machine, (s) => s.heard); @@ -2034,10 +2030,7 @@ describe("Talk from Ask Alpha's composer (spec/app/voice/index.md, \"Story: Hold await drawnUntil(alpha, area, Voice.Machine, (s) => s.ending && s.mic === "Closing"); expect([button("Microphone status unconfirmed")?.getAttribute("aria-pressed"), world.ask.said]).toEqual(["mixed", []]); await drawn(() => world.voice.emitCloud?.({ type: "speech-end", sessionId, text: asked })); - await later(alpha, CLOUD_TURN_GAP_MS); - await drawnUntil(alpha, area, Voice.Machine, (s) => s.phase === "Idle"); - const ended = await state(); - expect([ended.sent, ended.ending, ended.mic, world.ask.said]).toEqual([1, false, "Off", [asked]]); + await answeredThenEnded(talk, asked); }); // spec/app/voice/index.md, "Stop while the owner is speaking still sends what they said, Alpha answers it, and then Talk ends" diff --git a/packages/cli/test/cli.test.ts b/packages/cli/test/cli.test.ts index b4d94c7adf..6b06e59dd3 100644 --- a/packages/cli/test/cli.test.ts +++ b/packages/cli/test/cli.test.ts @@ -508,8 +508,11 @@ sys.exit(2) workflow_run: { id: 77, head_sha: pixel, head_branch: "main", repository_id: owner.id, head_repository_id: owner.id } }); const input = artifact("build", 42, earlier), delivered = artifact("delivery", 41, earlier), signedReceipt = artifact("sign", 45, end); const receipts = (rows: (typeof input)[]) => put("artifacts.json", [{ artifacts: rows }]); - const select = (kind: string) => JSON.parse(execFileSync("python3", [path.join(templateRoot, "scripts/ci/app_update_producer.py"), - "launcher-pixel-receipt-artifact", dir, kind, "1"], { encoding: "utf8", stdio: "pipe" })).id; + const select = (kind: string): unknown => { + const chosen = parseJson(execFileSync("python3", [path.join(templateRoot, "scripts/ci/app_update_producer.py"), + "launcher-pixel-receipt-artifact", dir, kind, "1"], { encoding: "utf8", stdio: "pipe" })); + return typeof chosen === "object" && chosen !== null && "id" in chosen ? chosen.id : undefined; + }; receipts([input, delivered, signedReceipt]); expect([select("build"), select("delivery"), select("sign")]).toEqual([42, 41, 45]); const previousSign = artifact("sign", 44, earlier); diff --git a/packages/ui/src/components/inbox/InboxListScreen.tsx b/packages/ui/src/components/inbox/InboxListScreen.tsx index c8b2dd0340..925ded53a0 100644 --- a/packages/ui/src/components/inbox/InboxListScreen.tsx +++ b/packages/ui/src/components/inbox/InboxListScreen.tsx @@ -180,7 +180,7 @@ export function InboxListScreen({ )) : null} {accounts.length > 1 && onAddAccount ? ( - + ) : null}
) : null} diff --git a/packages/ui/src/components/messaging/MessageItem.tsx b/packages/ui/src/components/messaging/MessageItem.tsx index ef5df33200..c89b91b0ef 100644 --- a/packages/ui/src/components/messaging/MessageItem.tsx +++ b/packages/ui/src/components/messaging/MessageItem.tsx @@ -745,10 +745,10 @@ export function MessageItem({ ) : onOpenSender ? ( ) : ( @@ -842,10 +842,10 @@ export function MessageItem({ onOpenSender ? ( ) : ( diff --git a/packages/ui/src/components/startup/StartupAccessRow.tsx b/packages/ui/src/components/startup/StartupAccessRow.tsx index c261043b57..089c2d499f 100644 --- a/packages/ui/src/components/startup/StartupAccessRow.tsx +++ b/packages/ui/src/components/startup/StartupAccessRow.tsx @@ -82,9 +82,7 @@ export function StartupAccessRow({ access, word, current = false, upcoming = fal "shrink-0 text-right text-sm", current && status === "ok" ? "font-medium text-foreground" - : upcoming - ? "text-muted-foreground/75" - : "text-muted-foreground/97 dark:text-muted-foreground", + : "text-muted-foreground/97 dark:text-muted-foreground", )} > {status === "busy" ? : } diff --git a/scripts/ci/app_update_producer.py b/scripts/ci/app_update_producer.py index 3d1c3fd709..6b6ecf2846 100644 --- a/scripts/ci/app_update_producer.py +++ b/scripts/ci/app_update_producer.py @@ -32,6 +32,8 @@ MAX_ARCHIVE_BYTES = 1_500_000_000 LEGACY_APK_MEMBER_BYTES = 400_000_000 PRIVATE_APK_BUCKET = "alpha-aosp-lab-20261024-private-apks" +RELEASE_DELIVERY_ARTIFACT = r"release-delivery-([1-9]\d*)-([1-9]\d*)" +RELEASE_LEDGER_ARTIFACT = "release-ledger" PIXEL_BOARD = "apps/app/aosp/pixel10a.json" PIXEL_INPUTS = ("eliza.lock.json", "apps/app/aosp/pixel10a-release.json", "apps/app/aosp/pixel10a-ota-channel.json", "apps/app/aosp/pixel10a-enrollment.json", "apps/app/aosp/pilot-system-update-enrollment.json", @@ -860,8 +862,8 @@ def publication_inputs(run_id, attempt, directory): statuses = gh_json(f"repos/{REPOSITORY}/deployments/{deployment}/statuses?per_page=100") released = [s["state"] for s in reversed(statuses) if s["log_url"] == job_url] require("in_progress" in released, "The release environment never ran this publication attempt") - delivery_id, delivery_attempt, artifact_id, digest = published_artifact_record(job, "download", r"release-delivery-([1-9]\d*)-([1-9]\d*)") - ledger_id, = published_artifact_record(job, "upload", "release-ledger") + delivery_id, delivery_attempt, artifact_id, digest = published_artifact_record(job, "download", RELEASE_DELIVERY_ARTIFACT) + ledger_id, = published_artifact_record(job, "upload", RELEASE_LEDGER_ARTIFACT) delivery = launcher_run(delivery_id, delivery_attempt, "workflow_dispatch", "failure" if delivery_id == run_id else "success") release_job(delivery, "deliver", "success") release_ancestor(delivery["head_sha"], original["head_sha"]) From 0181638e762e5e1f812a01817688b47692d70f6c Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 05:08:36 -0500 Subject: [PATCH 16/21] Fix remaining 3 CI verify blockers on develop - Raise V8 heap to 8192 MB and split apps/app/test into its own ESLint pass in lint:js so //#lint:js does not OOM at 4096 MB - Check [data-alpha-bubble] in telegram-cleanup.test.tsx so grouped follow-up bubble assertions inspect the bubble itself rather than the sibling avatar button's sr-only label - Expect Bearer mail-lease on POST /api/v1/eliza/google/connect/initiate in apps/app/test/fakes/inbox.ts to match eliza@6fc1d9729a59 and elizaCloud --- apps/app/test/fakes/inbox.ts | 2 +- apps/app/test/telegram-cleanup.test.tsx | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/app/test/fakes/inbox.ts b/apps/app/test/fakes/inbox.ts index 8948f4edf0..79e99e7d75 100644 --- a/apps/app/test/fakes/inbox.ts +++ b/apps/app/test/fakes/inbox.ts @@ -253,7 +253,7 @@ export function inboxRoutes(scene: InboxScene): Route[] { (request, url) => { const consent = scene.consent; if (request.method !== "POST" || url.pathname !== `${google}/connect/initiate` || consent === undefined) return; - if (request.headers.get("authorization") !== "Bearer device-key") return refused(401, "authentication_required"); + if (request.headers.get("authorization") !== "Bearer mail-lease") return refused(401, "authentication_required"); return request.json().then(({ capabilities, redirectUrl }: { capabilities: string[]; redirectUrl?: string }) => { if (redirectUrl !== undefined && !connectReturn.test(redirectUrl)) return refused(400, "invalid_request"); consent.requests.push(capabilities); diff --git a/apps/app/test/telegram-cleanup.test.tsx b/apps/app/test/telegram-cleanup.test.tsx index e206a385ed..97540fcd06 100644 --- a/apps/app/test/telegram-cleanup.test.tsx +++ b/apps/app/test/telegram-cleanup.test.tsx @@ -92,7 +92,7 @@ describe('Telegram signed-in UI cleanup (spec/app/telegram/index.md, "Story: Use await vi.waitFor(() => expect(button(/^Team/)).toBeDefined()); await press(/^Team/); await vi.waitFor(() => expect(shownText()).toContain("First hello")); - const bubbles = [...document.querySelectorAll('[role="log"][aria-label="Telegram messages"] article')]; + const bubbles = [...document.querySelectorAll('[role="log"][aria-label="Telegram messages"] article [data-alpha-bubble]')]; expect(bubbles).toHaveLength(3); expect(bubbles[0]?.textContent).toContain("Alex"); expect(bubbles[1]?.textContent).not.toContain("Alex"); diff --git a/package.json b/package.json index ff597d029f..06a5e252cb 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "test:models": "node vibestack/spec.ts tasks check", "typecheck": "vibelang --noEmit -p tsconfig.json", "lint": "node vibestack/spec.ts tasks //#lint:js //#lint:css", - "lint:js": "eslint --max-warnings 0 --cache --cache-location .cache/eslint/root --ignore-pattern \"apps/**\" --ignore-pattern \"packages/**\" . && eslint --max-warnings 0 --cache --cache-location .cache/eslint/packages packages && eslint --max-warnings 0 --cache --cache-location .cache/eslint/apps --ignore-pattern \"apps/app/**\" apps && eslint --max-warnings 0 --cache --cache-location .cache/eslint/app apps/app", + "lint:js": "export NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--max-old-space-size=8192\" && eslint --max-warnings 0 --cache --cache-location .cache/eslint/root --ignore-pattern \"apps/**\" --ignore-pattern \"packages/**\" . && eslint --max-warnings 0 --cache --cache-location .cache/eslint/packages packages && eslint --max-warnings 0 --cache --cache-location .cache/eslint/apps --ignore-pattern \"apps/app/**\" apps && eslint --max-warnings 0 --cache --cache-location .cache/eslint/app --ignore-pattern \"apps/app/test/**\" apps/app && eslint --max-warnings 0 --cache --cache-location .cache/eslint/app-test apps/app/test", "lint:css": "stylelint \"**/*.css\" --allow-empty-input", "analyze": "knip && madge --circular vibestack packages apps && jscpd .", "quick": "node vibestack/spec.ts tasks typecheck test //#lint:js //#lint:css", From 391e0cd542fd4f57196791ea173aec36e079c238 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 03:40:25 -0500 Subject: [PATCH 17/21] Wait in Calendar's two-calendar card journey for the decline and the next card in the machine, not a one-second look at the page --- apps/app/test/calendar.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/app/test/calendar.test.tsx b/apps/app/test/calendar.test.tsx index 91e3e646ee..d3f941fdbe 100644 --- a/apps/app/test/calendar.test.tsx +++ b/apps/app/test/calendar.test.tsx @@ -1905,7 +1905,9 @@ describe("on a phone", () => { await vi.waitFor(() => expect(askedCard()).toContain("camera setup")); expect(["Eliza Calendar", "Family", "Agent Calendar"].map((text) => askedCard().includes(text))).toEqual([true, false, false]); await press("Decline"); + await until(alpha, agent, Changes, (a) => a.result === "Declined"); await file("approval-google", "lens check", 11, "owner@alpha.test"); + await until(alpha, agent, Changes, (a) => a.stage === "Awaiting" && a.result === "NoResult"); await vi.waitFor(() => expect(askedCard()).toContain("lens check")); expect(["Family", "Eliza Calendar"].map((text) => askedCard().includes(text))).toEqual([true, false]); expect([Boolean(button("Approve")), world.calendar.writes]).toEqual([true, ["reject approval-resident"]]); From 4c12a9fb2c1d6f8ced03a9b11e90f92d2e0000d2 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 05:10:28 -0500 Subject: [PATCH 18/21] Take the resting map's ring of asked tiles once it stops growing, so a late batch of it is not read as asked ahead --- packages/ui/test/map.browser.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/test/map.browser.test.tsx b/packages/ui/test/map.browser.test.tsx index a6eb1a345f..4cd0e6b073 100644 --- a/packages/ui/test/map.browser.test.tsx +++ b/packages/ui/test/map.browser.test.tsx @@ -123,7 +123,12 @@ describe('Moving map (spec/app/maps/credits.md, "By the owner\'s choice, the map ahead: { frames: 20, limit: 8, ring: 1, tile: (z, x, y) => { asked.push({ z, x, y }); } }, }, ({ zoom }) => { settledZoom = zoom; }); await expect.poll(async () => (await shares(host)).sharp, { timeout: 10_000 }).toBeGreaterThan(0.95); - await expect.poll(() => asked.length, { timeout: 10_000 }).toBeGreaterThan(0); + let restingAsked = -1; + await expect.poll(() => { + const steady = asked.length > 0 && asked.length === restingAsked; + restingAsked = asked.length; + return steady; + }, { timeout: 10_000, interval: 250 }).toBe(true); const ring = asked.splice(0); const columns = (tiles: ReadonlyArray<{ x: number }>) => [...new Set(tiles.map((one) => one.x))].sort((a, b) => a - b); const startColumn = 2 ** sharpZoom / 2; From c7c5d39379a427dbf0ef77f5a68bec284f79df65 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 10:36:30 -0500 Subject: [PATCH 19/21] Take develop's fixes for this promotion's checks: drop an unused import, and the last two ratcheted comments so the tools selftest no longer type-checks a real app file in its own heap once .eliza is linked --- apps/app/src/assistant/attachments.vibe | 1 - apps/app/test/app.browser.test.tsx | 1 - eslint.config.js | 2 +- packages/ui/vite.config.ts | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/app/src/assistant/attachments.vibe b/apps/app/src/assistant/attachments.vibe index 9bb5a21083..b855e43753 100644 --- a/apps/app/src/assistant/attachments.vibe +++ b/apps/app/src/assistant/attachments.vibe @@ -12,7 +12,6 @@ import { Machine as Shell, canRaise } from "../../gen/app__shell.effect.vibe" import { type NoteTranscript, type NotesSelection, transcriptCurrent } from "../notes/selection.vibe" import { fresh } from "../runtime/index.vibe" import { contained } from "../runtime/index.vibe" -import type { PageSpeech } from "../voice/voice.vibe" import { reencodeImage } from "./image-encode.ts" import { type ContactAttachmentScope, contactFileTargetCurrent, sameContactFileTarget } from "./contact-attachments.vibe" import { type Attached, type BrowserPageAttachment, type BrowserPageOffer, type ContactFileTarget, type TranscriptAttachment, Talk } from "./talk.vibe" diff --git a/apps/app/test/app.browser.test.tsx b/apps/app/test/app.browser.test.tsx index 69d0b385a0..6b697ceb7d 100644 --- a/apps/app/test/app.browser.test.tsx +++ b/apps/app/test/app.browser.test.tsx @@ -189,7 +189,6 @@ it("Full Ask Alpha keeps focus off the Home it covers (spec/app/shell/index.md, // spec/app/assistant/context.md, "A turn describes the view in front by its labeled controls and visible text, never a sensitive or withheld view, a secret field, the assistant's own chat or a review card": the Home that Ask Alpha covers is still the view in front, described by its tiles. expect(seeScreen(document)?.controls.map(({ control }) => control.label)).toContain("Notes"); - // The emulated touch pointer puts the same full dock beside Home. await page.viewport(1024, 390); await expect.poll(() => { note?.focus(); diff --git a/eslint.config.js b/eslint.config.js index 7d8a5d77d1..3ba6f5908f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -125,7 +125,7 @@ const effects = { } const code = { rules: { comments, effects } } const own = ["apps/**", "packages/**"] -const commented = { "apps/app/test/app.browser.test.tsx": 1, "packages/ui/vite.config.ts": 1 } +const commented = {} const scheduled = {} // The tool reads Quint's JSON and the TypeScript compiler API as `any` at its boundaries; packages and apps stay strict. diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index e3a8cb86fc..06e70a95c9 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -1,5 +1,4 @@ import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "vite"; -// What Storybook builds with; the tests share it through vitest.config.ts. export default defineConfig({ plugins: [tailwindcss()] }); From aacfe8b7a663c4268636870812e9806a38664161 Mon Sep 17 00:00:00 2001 From: Shaw Walters Date: Fri, 4 Dec 2026 07:56:10 -0800 Subject: [PATCH 20/21] Accept develop's reviewed rules for the promotion, model the settled email draft, and cite the uncited approval tests The anchoring rule's prose says an email draft opened in Inbox or declined is never drawn at the transcript's foot, but its Quint had no draft; draftDrawnAtFoot and two laws now say it, and the transcript asks it. The walkthrough rule now says the phone's location and notification settings are on by Android's defaults while the image grants Alpha's permission to use each. Five inline-approval journeys and the indoor network-location journey now cite their stories. The 96 review items were read for prose and Quint agreeing, then recorded with pnpm accept. --- apps/app/src/assistant/transcript.tsx | 4 +- apps/app/test/assistant.test.tsx | 2 +- apps/app/test/inline-approvals.test.tsx | 10 +- spec/app/assistant/cards.md | 6 + spec/app/image/index.md | 7 +- spec/lock.json | 297 +++++++++++++----------- 6 files changed, 175 insertions(+), 151 deletions(-) diff --git a/apps/app/src/assistant/transcript.tsx b/apps/app/src/assistant/transcript.tsx index d7e6ef6162..6268b3cd57 100644 --- a/apps/app/src/assistant/transcript.tsx +++ b/apps/app/src/assistant/transcript.tsx @@ -13,7 +13,7 @@ import { useMachine as useConversation } from "../../gen/app__assistant.react.ts import { loading as pageLoading, sendResumesFollowing } from "../../gen/app__assistant__chats.ts"; import { useMachine as useChats } from "../../gen/app__assistant__chats.react.ts"; import { useMachine as useCards } from "../../gen/app__assistant__cards.react.ts"; -import { offerShown, reviewCardAnchor, reviewShown } from "../../gen/app__assistant__cards.ts"; +import { draftDrawnAtFoot, offerShown, reviewCardAnchor, reviewShown } from "../../gen/app__assistant__cards.ts"; import { type Composer as Writing, type Event as ComposerEvent, Machine as ComposerMachine } from "../../gen/app__assistant__composer.effect.vibe"; import { enabled as composerAllows, textLimit } from "../../gen/app__assistant__composer.ts"; import { useMachine as useComposer } from "../../gen/app__assistant__composer.react.ts"; @@ -461,7 +461,7 @@ export const LiveTranscript = memo(function LiveTranscript({ runtime, messageAct return [...(offer ? [row] : []), ...anchoredMedia, ...chips.map(receipt), ...emailCards, ...(row.id === endedUnder ? calendarCard : [])]; }); const unplacedMediaCards = activeMedia.filter(({ card }) => mediaAnchors.get(card.id) === undefined).map(mediaRow); - const unplacedEmailDrafts = emailOffers.filter((item) => emailAnchors.get(item.id) === undefined && item.status === "pending").map(emailRow); + const unplacedEmailDrafts = emailOffers.filter((item) => draftDrawnAtFoot(item.status === "pending", emailAnchors.get(item.id) !== undefined)).map(emailRow); const offer = seen.recordingSummary; const recordingSummary = offer !== undefined && !talking.context.sensitive && offer.conversation === shown.chosen && lines.some((line) => !line.mine && line.id === offer.message) diff --git a/apps/app/test/assistant.test.tsx b/apps/app/test/assistant.test.tsx index b537d398da..ea27bb215d 100644 --- a/apps/app/test/assistant.test.tsx +++ b/apps/app/test/assistant.test.tsx @@ -1556,7 +1556,7 @@ it("A Maps request keeps going when the phone's position has not arrived yet (sp }); }); -it("Carries AlphaNetworkLocation indoors on a near-me turn when GPS is absent (spec/app/assistant/context.md, \"The network is looked up only when GPS has nothing current, and its answer is reused before it is asked again\")", async () => { +it('Carries AlphaNetworkLocation indoors on a near-me turn when GPS is absent (spec/app/assistant/context.md, "The network is looked up only when GPS has nothing current, and its answer is reused before it is asked again")', async () => { const world = { ...scene(), phone: true }; world.maps.here = undefined; world.platform.network.lat = 37.329; diff --git a/apps/app/test/inline-approvals.test.tsx b/apps/app/test/inline-approvals.test.tsx index 9ce288c37d..c3022391b5 100644 --- a/apps/app/test/inline-approvals.test.tsx +++ b/apps/app/test/inline-approvals.test.tsx @@ -65,7 +65,7 @@ async function askNewContact( } describe("Inline chat approvals in Ask Alpha", () => { - it("renders inline New Contact card with 1-tap Save without leaving chat", async () => { + it('renders inline New Contact card with 1-tap Save without leaving chat (spec/app/contacts/agent.md, "Story: Approve what the agent asked")', async () => { const world = alphaImage(); const review = textReview(world.notes.owner, "contact-create-1", { type: "contact_create", @@ -93,7 +93,7 @@ describe("Inline chat approvals in Ask Alpha", () => { expect(shellAfterSave.assistant).toBe("Sheet"); }); - it("opens Alpha's polished New contact sheet prefilled when tapping Edit on the inline card", async () => { + it('opens Alpha\'s polished New contact sheet prefilled when tapping Edit on the inline card (spec/app/contacts/agent.md, "Story: Approve what the agent asked")', async () => { const world = alphaImage(); const review = textReview(world.notes.owner, "contact-create-2", { type: "contact_create", @@ -107,7 +107,7 @@ describe("Inline chat approvals in Ask Alpha", () => { expect(document.querySelector("textarea[aria-label='Notes']")?.className).toContain("resize-none"); }); - it("renders Contact Update/Delete inline inside Ask Alpha when open and falls back to Sheet when closed", async () => { + it('renders Contact Update/Delete inline inside Ask Alpha when open and falls back to Sheet when closed (spec/app/contacts/agent.md, "Story: Approve what the agent asked")', async () => { const world = alphaImage(); world.telephony.people = [ { @@ -149,7 +149,7 @@ describe("Inline chat approvals in Ask Alpha", () => { expect(document.querySelector("[role=region][data-alpha-review]")).toBeNull(); }); - it("renders Calendar Availability check and share inline inside Ask Alpha with zero floating dialog", async () => { + it('renders Calendar Availability check and share inline inside Ask Alpha with zero floating dialog (spec/app/calendar/sharing.md, "Story: Choose the calendars and see the answer before it is shared")', async () => { const world = alphaImage(); const startMs = dayStart(civilDay(new Date(2026, 10, 24, 9).getTime())) + 13 * HOUR_MS; world.now = startMs - 4 * HOUR_MS; @@ -203,7 +203,7 @@ describe("Inline chat approvals in Ask Alpha", () => { await vi.waitFor(() => expect(shownText()).toContain("Shared your availability.")); }); - it("renders inline Telegram and Slack Send draft cards in Ask Alpha with Edit, Send, and Decline", async () => { + it('renders inline Telegram and Slack Send draft cards in Ask Alpha with Edit, Send, and Decline (spec/app/approvals/proposal.md, "Story: Be asked before Alpha acts")', async () => { const world = alphaImage(); Object.assign(world.telegram.status, { user: world.telegram.me, diff --git a/spec/app/assistant/cards.md b/spec/app/assistant/cards.md index 33115fcf0d..9f2dba2167 100644 --- a/spec/app/assistant/cards.md +++ b/spec/app/assistant/cards.md @@ -101,6 +101,12 @@ pure def reviewCardAnchor(offerReplyDrawn: bool, requestDrawn: bool, requestRepl pure def lawADrawnTurnAlwaysAnchorsItsReviewCard(offerReplyDrawn: bool, requestDrawn: bool, requestReplyDrawn: bool): bool = (offerReplyDrawn or requestDrawn) implies reviewCardAnchor(offerReplyDrawn, requestDrawn, requestReplyDrawn) != TranscriptFoot + +pure def draftDrawnAtFoot(pending: bool, anchored: bool): bool = pending and not(anchored) + +pure def lawASettledDraftIsNeverDrawnAtTheFoot(anchored: bool): bool = not(draftDrawnAtFoot(false, anchored)) + +pure def lawAnAnchoredDraftIsNeverDrawnAtTheFoot(pending: bool): bool = not(draftDrawnAtFoot(pending, true)) ``` ### At most one pending open-page review waits in a conversation, and asking for the same page again keeps its card diff --git a/spec/app/image/index.md b/spec/app/image/index.md index 54c8b06cd0..b719d37f2f 100644 --- a/spec/app/image/index.md +++ b/spec/app/image/index.md @@ -220,9 +220,10 @@ pure def lawTheFirstBootGrantsFitAndroidsLimit(named: List[str]): bool = ### Every access the startup walkthrough offers is one the image grants Each is a first-boot grant, but all-files access, which Android grants a -preinstalled app that asks for it. Location and notifications are switched -on by Android's own defaults. A walkthrough step added without a grant -fails this rule. +preinstalled app that asks for it. The phone's own location setting and +notifications are on by Android's defaults; the image grants Alpha's +permission to use each. A walkthrough step added without a grant fails this +rule. ```quint import steps as Steps from "../startup/steps" diff --git a/spec/lock.json b/spec/lock.json index ef6298b90b..ed1628bc1a 100644 --- a/spec/lock.json +++ b/spec/lock.json @@ -251,7 +251,7 @@ "b2923051a890" ], "Story: Run Alpha's agent on the phone / The agent is Alpha, made by Alpha Compute, with a system prompt": [ - "f2246b3506e8", + "e663ce9b7bca", "d112cecddc0f" ], "Story: Run Alpha's agent on the phone / The pack carries the plugins the old phone's agent loaded, under the pinned eliza's names, and the launch loads them with the agent's own modules the old agent had": [ @@ -1782,7 +1782,7 @@ }, "spec/app/account/provider.md": { "@document": [ - "505c6444710a" + "1c5408be20de" ], "## Story: See where my requests go": [ "d1d117e30806" @@ -2225,13 +2225,18 @@ "199819126c40" ], "## Story: Use Alpha before signing in": [ - "d1b1891e83d2" + "155332063113" ], "Story: Use Alpha before signing in / Alpha asks for a sign-in only when the phone has said none is saved and neither the owner's own key nor on-device AI is in use": [ "cd4ccdc0fc12", "33d9ecd58674", "199819126c40" ], + "Story: Use Alpha before signing in / Signed in to an account whose plan allows AI, a language model or voice the owner never chose runs on Alpha Cloud, and one the owner chose stays where they put it": [ + "a1865677f122", + "2c85b7f4d458", + "0831218fdeed" + ], "## Story: Keep my sign-in across a restart": [ "83741127cc93" ], @@ -2340,7 +2345,7 @@ "e21c815752fb" ], "Story: Sign in when Alpha needs it / Saving the owner's own key, or continuing without an account, ends a required sign-in, and drops any code on screen": [ - "d7bf3642ebb6", + "d57e02f037f4", "70a0872cd1d7", "ed925390c3f5" ], @@ -3402,8 +3407,8 @@ "cd8848d391cd" ], "Story: Keep a summary / A pending phone-step review card stays anchored to the turn that offered it": [ - "f22b53f435d5", - "4fce76ac2cad" + "19a87888c43d", + "ecdd7ea52ce4" ], "Story: Keep a summary / At most one pending open-page review waits in a conversation, and asking for the same page again keeps its card": [ "f514aea0c8ec", @@ -4291,7 +4296,7 @@ "e1b8a82e361b" ], "Story: Let my agent see the screen in front and work its controls / A turn describes the view in front by its labeled controls and visible text, never a sensitive or withheld view, a secret field, the assistant's own chat or a review card": [ - "ff01f2c3450d", + "5a8fd1dc7d46", "0f521049b52a", "e74ec73b2f8e" ], @@ -8752,7 +8757,7 @@ }, "spec/app/control/index.md": { "@document": [ - "a2380a3f0741" + "e1ebb5328890" ], "## Story: Control a third-party app within an owner-approved lease": [ "1d25cf78e90a" @@ -11556,6 +11561,43 @@ "c280a72677cb" ] }, + "spec/app/startup/steps.md": { + "@document": [ + "8e069115b83e" + ], + "## Story: Know each access by name": [ + "bb908cec59e8" + ], + "Story: Know each access by name / The accesses are notifications, the microphone, the camera and location, then on the phone the calendar, photos and files": [ + "e4fd9d16898d", + "cae25084159a" + ], + "Story: Know each access by name / Files has no prompt of Android's own": [ + "f6d69030915f", + "a0be2c91f128", + "662cdad23d13" + ], + "Story: Know each access by name / Each access is checking, can be requested, needs Android's Settings, is ready, or could not be checked": [ + "583ff047610b", + "95c69b07a33c", + "3e0cb8a14507" + ], + "Story: Know each access by name / Each row says Allowed, or how far, or Off, Ask, Checking or Couldn't check": [ + "d38c8351723b", + "1fb107dc1260", + "ea5314021c58" + ], + "Story: Know each access by name / A ready access never reads as off, one switched off never reads as allowed, and one not yet read never reads as allowed": [ + "e3b0c44298fc", + "23a524ccb4d8", + "44f44658a207" + ], + "Story: Know each access by name / An access is asked for at most once, and then sent to Settings": [ + "5d98c6a4d4ba", + "3efc71003cba", + "ea5314021c58" + ] + }, "spec/release/os.md": { "@document": [ "bafbf928b02c" @@ -12079,68 +12121,75 @@ }, "spec/app/image/index.md": { "@document": [ - "53c09bab82ae" + "d22d34fbf924" ], "## Story: Stage Alpha into an image": [ "0f02eed93a99" ], "Story: Stage Alpha into an image / A stage puts the launcher into the Cuttlefish phone or the Pixel 10a, as a development or a production build, with the listener and source patches it names": [ "2e5abcbeedae", - "4d0a01507471" + "9ef46b99b177" ], "Story: Stage Alpha into an image / A production stage, and every listener image, needs a reviewed launcher descriptor and a product with no field unset": [ "99a8865487e1", "ec13c54bbfd4", - "0820dd1d9919" - ], - "Story: Stage Alpha into an image / Owner telephony is for a development stage of either target, and never for a listener image": [ - "3d589c8b8678", - "b3b2c3ca4974", - "0820dd1d9919" + "daa44b228849" ], "Story: Stage Alpha into an image / A listener image is a Pixel 10a stage with the listener, its qualification record and the chip, ops, protected power and Sense policy patches": [ "c133ccbac491", "7947cdb3085f", - "0820dd1d9919" + "daa44b228849" ], "Story: Stage Alpha into an image / The Sense policy patch belongs only to a listener image, and the protected power and generic assist patches never come together": [ "a231cad02187", "c0dde6de2646", - "0820dd1d9919" + "daa44b228849" ], "Story: Stage Alpha into an image / The branding packet is staged only into a production Pixel 10a": [ "e3b0c44298fc", "0501aef7bc06", - "0820dd1d9919" + "daa44b228849" ], "Story: Stage Alpha into an image / A stage is admitted only when no rule above refuses it, and a refusal names every problem": [ "9e78aa913552", - "2ed71d024f07", - "b703b5dbab86" + "328d0b747c20", + "e36cb7cb94c8" ], "## Story: Keep the phone and messages on Alpha's phone": [ - "4c6ed6408fca" + "2621d86054c9" ], - "Story: Keep the phone and messages on Alpha's phone / Image telephony is staged for a production stage, a listener image and an owner telephony stage, and for no other": [ - "31376c13daef", - "24459258177b", - "0820dd1d9919" - ], - "Story: Keep the phone and messages on Alpha's phone / Home and Autofill defaults are staged only for a production stage or a listener image, so an owner's development phone keeps the owner's choices": [ - "e3b0c44298fc", - "a958dafd39a6", - "0820dd1d9919" + "Story: Keep the phone and messages on Alpha's phone / Every image gives the launcher Home, the assistant, dialer, SMS, Autofill, notification and Do Not Disturb access, and the power-save exemption": [ + "cbc7a8b5ea26", + "fbe4389b1678" ], "## Story: Let a handed-over phone update its launcher on its own": [ - "4924a5d72f8f" + "4debed8a00a9" + ], + "Story: Let a handed-over phone update its launcher on its own / On an image the launcher holds exactly three privileged permissions: its phone's own identifiers, the install of its own updates and the secure settings it switches on for itself": [ + "a61dd0b296ee", + "eabcd4693ee3" ], - "Story: Let a handed-over phone update its launcher on its own / On an image the launcher holds exactly two privileged permissions, its phone's own identifiers and the install of its own updates, or none": [ - "3e314ead6300", - "708771075ba9" + "## Story: Start a fresh phone with nothing to allow": [ + "19465ad3e97e" ], - "Story: Let a handed-over phone update its launcher on its own / The first-boot grants are exactly the startup walkthrough's, Contacts and phone state, each revocable, and never messages, calls or call history": [ - "e45f7e7f4291", - "24a757211679" + "Story: Start a fresh phone with nothing to allow / The launcher holds at first boot every runtime permission it asks for, each revocable": [ + "a8968a4044a3", + "4b49aadb15db" + ], + "Story: Start a fresh phone with nothing to allow / Every access the startup walkthrough offers is one the image grants": [ + "1a47a0b061d9", + "cd1d2c46902e", + "92bb3be7c935" + ], + "Story: Start a fresh phone with nothing to allow / Both staging commands stage the same launcher policy, and refuse a launcher that is not a product priv-app or misses a grant": [ + "f03c9579c800", + "b139b5f9508d", + "8b2fd8153ce3" + ], + "Story: Start a fresh phone with nothing to allow / The owner keeps the choice of installing other apps": [ + "7e830a2832cd", + "19f490fa912f", + "702cbbcc190b" ], "## Story: Update an Alpha Pixel by cable, and get back": [ "038886c633ba" @@ -13661,7 +13710,12 @@ ], "Story: See the map / Only the surface in place reports whether it was drawn": [ "e3b0c44298fc", - "70075d6ac1e6", + "e27d263053dd", + "e77300cbc3f8" + ], + "Story: See the map / A drawn map stays drawn until a new surface replaces it": [ + "5abbfe8da26b", + "6b4b1aa198c7", "e77300cbc3f8" ], "Story: See the map / Retry draws a broken map again on a new surface": [ @@ -13785,7 +13839,7 @@ "cdfab4b80716" ], "Story: See the map for what I am looking at / A failed tile never breaks a surface whose style has loaded, and a cancelled tile breaks nothing": [ - "99713da4b4c7", + "76e5354859d7", "0cfea0458464" ], "Story: See the map for what I am looking at / The compass shows only while the map is turned or tilted and guidance is not following, and puts north up": [ @@ -14246,7 +14300,7 @@ "Story: Connect through my cloud account / The map surface says whether it was drawn, and Retry draws it again": [ "e3b0c44298fc", "c103da6ecc97", - "fd37cdf6bfe2" + "f96dbc9d0d04" ], "Story: Connect through my cloud account / The map can be broken while guiding": [ "e3b0c44298fc", @@ -16739,8 +16793,8 @@ "6fe5fd4a4549", "8ee04cfd1feb" ], - "Story: Let Alpha see my notifications / Listener access is granted only in Android's Settings, which Alpha opens for the owner": [ - "e3b0c44298fc", + "Story: Let Alpha see my notifications / Alpha never grants listener access itself: Android grants it, by the image's default or in its Settings, which Alpha opens for the owner": [ + "10c8c574c9b6", "3ddd7c339af5", "baa3f13a592d" ], @@ -20291,7 +20345,7 @@ "e357e7bd949e" ], "Story: Change what only Android can change / Each Android page is offered on the Settings page it belongs to": [ - "8e9318191fce", + "129f869dd13c", "5c6be0e552e0", "e8587946a136" ], @@ -21528,43 +21582,6 @@ "e3f12c0735a9" ] }, - "spec/app/startup/steps.md": { - "@document": [ - "8e069115b83e" - ], - "## Story: Know each access by name": [ - "bb908cec59e8" - ], - "Story: Know each access by name / The accesses are notifications, the microphone, the camera and location, then on the phone the calendar, photos and files": [ - "e4fd9d16898d", - "cae25084159a" - ], - "Story: Know each access by name / Files has no prompt of Android's own": [ - "f6d69030915f", - "a0be2c91f128", - "662cdad23d13" - ], - "Story: Know each access by name / Each access is checking, can be requested, needs Android's Settings, is ready, or could not be checked": [ - "583ff047610b", - "95c69b07a33c", - "3e0cb8a14507" - ], - "Story: Know each access by name / Each row says Allowed, or how far, or Off, Ask, Checking or Couldn't check": [ - "d38c8351723b", - "1fb107dc1260", - "ea5314021c58" - ], - "Story: Know each access by name / A ready access never reads as off, one switched off never reads as allowed, and one not yet read never reads as allowed": [ - "e3b0c44298fc", - "23a524ccb4d8", - "44f44658a207" - ], - "Story: Know each access by name / An access is asked for at most once, and then sent to Settings": [ - "5d98c6a4d4ba", - "3efc71003cba", - "ea5314021c58" - ] - }, "spec/app/startup/actor.md": { "@document": [ "49275572c273" @@ -21637,7 +21654,7 @@ "6a77780cb52a" ], "Story: Walk through each access in order / The walkthrough holds each access as Android last reported it, the choices made, the choices last saved, and what is in flight": [ - "ebfc2309009d", + "86b42ef9d80e", "12f17315d0cc", "45e440352a66" ], @@ -21657,7 +21674,7 @@ "cf7dd6730050" ], "Story: Walk through each access in order / Alpha starts, or starts again, with the choices last saved and every asking Android showed, and reads every access again": [ - "5c1b64e64f71", + "4db1e54b92c2", "debd3736d39e", "1f6bb325b1da" ], @@ -21687,11 +21704,11 @@ "959348035aa0" ], "Story: Walk through each access in order / Skip passes a step whose state is known and that is not waiting on Android, or one stalled for twenty seconds": [ - "fdca82c9a2cd", + "a5582f9c556f", "09c6e4920fdc", "1b06320b78d6" ], - "Story: Walk through each access in order / A step still being read twenty seconds after it was shown stalls, even one the image granted ahead": [ + "Story: Walk through each access in order / A step still being read twenty seconds after it was shown stalls, even one that would pass by itself": [ "e3b0c44298fc", "f4f00ea1a261", "d744b861c305" @@ -21711,7 +21728,7 @@ "cb6ae50a13ab", "e118c8360803" ], - "Story: Walk through each access in order / Only the owner, an access the image granted ahead, or an earlier version's walkthrough moves the walkthrough; Android's answers never do": [ + "Story: Walk through each access in order / Only the owner, an access Android already allows, or an earlier version's walkthrough moves the walkthrough; Android's answers never do": [ "f513c7fd9298", "fafb533d75fd", "6cb34708b1fd" @@ -21873,22 +21890,22 @@ "f4b9aa5a113c" ], "Story: Be asked when Alpha is ready for it / The walkthrough shows only for an owner who is set up, with nothing over it, until its last step": [ - "183b888adcd8", + "19e5918be69a", "7a5b3940264a", "3b3acdec718a" ], - "Story: Be asked when Alpha is ready for it / An access the image granted ahead passes by itself, as continued, unless Android's prompt or a request is waiting": [ + "Story: Be asked when Alpha is ready for it / An access Android already allows passes by itself, as continued, unless Android's prompt or a request is waiting": [ "140fa936105b", "8a4201b7b7f0", "1b06320b78d6" ], - "Story: Be asked when Alpha is ready for it / A step the image granted ahead passes, unless the owner looks away first": [ + "Story: Be asked when Alpha is ready for it / A step Android already allows passes, unless the owner looks away first": [ "3721d798615c", "d58cb1fab835", - "ff5ab5c9dedf" + "9def209c5b69" ], "Story: Be asked when Alpha is ready for it / A walkthrough that is set up and uncovered shows a step or ends": [ - "84b78a381af6", + "1b2b1aa0eed9", "84a478bb8ac1", "de94d699c51c" ], @@ -21902,17 +21919,17 @@ "c2d7b7216f70", "6cb34708b1fd" ], - "Story: Be asked when Alpha is ready for it / An image can pass the accesses it granted": [ + "Story: Be asked when Alpha is ready for it / A phone can pass the accesses Android already allows": [ "e3b0c44298fc", "571fbe5ecb88", "6cb34708b1fd" ], - "Story: Be asked when Alpha is ready for it / An image stops at an access it did not grant": [ + "Story: Be asked when Alpha is ready for it / A phone stops at an access Android does not allow": [ "e3b0c44298fc", "bce7f6454843", "de94d699c51c" ], - "Story: Be asked when Alpha is ready for it / An image step Android never answers is shown, with Skip": [ + "Story: Be asked when Alpha is ready for it / A phone step Android never answers is shown, with Skip": [ "e3b0c44298fc", "31cd59677731", "d744b861c305" @@ -22049,74 +22066,74 @@ "a2f38b025bec" ], "Story: Come up knowing where Alpha runs / Alpha knows whether it runs on a phone and in a test build, reads the rest, and keeps what decides the surface": [ - "087abc3215ce", + "8198cd459229", "a32a5e7ad79e", - "165e4ce8d4c8" + "b3096b798545" ], "Story: Come up knowing where Alpha runs / The page starts once, by asking the phone for its facts": [ "e3b0c44298fc", "40e25438e35b", - "2f951b588223" + "e117e70c442b" ], "Story: Come up knowing where Alpha runs / The first answer decides the surface, tells Home which it is, and begins the walkthrough off the assistant-only surface; every answer says what the phone admits and how it writes times": [ - "9d755c0f9a7c", - "1c152d3448cb", + "ed1a46724afd", + "970ce173d782", "99aa36a48fd3" ], "Story: Come up knowing where Alpha runs / A read that fails, or is not answered within ten seconds, still lets Alpha start, and admits nothing it did not hear": [ "b7af309ef29b", - "0933c6b7f1c3", - "9b365c2d252b" + "0160823585e4", + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Coming back to the front reads the facts again": [ "e3b0c44298fc", "5967bf1e0863", - "2f951b588223" + "e117e70c442b" ], "Story: Come up knowing where Alpha runs / Only a phone is the launcher, the assistant surface or an Alpha image": [ "e3b0c44298fc", "61453e125d8a", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Nothing is taken as known before the first answer": [ "f14426d245dc", "c01265f0c6ce", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Nothing is known before Alpha has asked": [ "9b48c1ecf226", "9018570b7b59", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Once decided, the surface does not change while the page lives": [ "9642e6950554", "77d0f193daa2", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Every answer about the phone is passed on: what it admits to the shell, and how it writes times to the areas that show them": [ "52fb7870454b", "17247de0e2cf", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / Home is told its surface, and the walkthrough begun, once, when Alpha first knows where it runs, and the walkthrough never on the assistant-only surface": [ - "6e9fbd9a7e99", - "f768e54b6a26", - "585aac07c47c" + "b9c4f951aa8e", + "62122159eeb1", + "fa3d134a90f0" ], "Story: Come up knowing where Alpha runs / Alpha comes to know the phone's facts once it has asked": [ "7e96232405be", "4ef08e52773c", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / A failed first read still starts Alpha": [ "e3b0c44298fc", "cdc5c90454f9", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Come up knowing where Alpha runs / A read the phone never answers still starts Alpha": [ "e3b0c44298fc", "4a461e06fea2", - "9b365c2d252b" + "e65044a46bb4" ], "## Story: Start in mock mode only in a test build": [ "912b8a4c4f38" @@ -22124,22 +22141,22 @@ "Story: Start in mock mode only in a test build / Mock mode and fixtures are admitted only in a test build": [ "a427c767ceb2", "514665c8a337", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Start in mock mode only in a test build / Mock mode shows its banner on every surface, and Exit mock mode leaves it": [ "cfbb7f376e8e", "577ab8ed8de5", - "a8faddd4bc66" + "b1f066dfe27a" ], "Story: Start in mock mode only in a test build / A test build can run in mock mode": [ "e3b0c44298fc", "132aa3b2bc91", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Start in mock mode only in a test build / Mock mode can be left": [ "e3b0c44298fc", "83a0e98fe871", - "9b365c2d252b" + "e65044a46bb4" ], "## Story: Show the surface that fits": [ "851bff2a6fa4" @@ -22147,22 +22164,22 @@ "Story: Show the surface that fits / Alpha is the launcher's Home, the assistant-only surface, or a plain page": [ "a0ad1e723d5b", "d66ea2cefb31", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Show the surface that fits / Alpha can run as a plain page in a browser": [ "e3b0c44298fc", "24afa040145f", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Show the surface that fits / The assistant-only surface shows chat and close, and mock mode's banner, and nothing of Home": [ "18491c8a0283", "f561f9466a8d", - "8679384d06dd" + "2d3462efabd7" ], "Story: Show the surface that fits / Alpha can be the assistant-only surface": [ "e3b0c44298fc", "e224d1d686bf", - "a8faddd4bc66" + "b1f066dfe27a" ], "## Story: Wait for the agent": [ "e3d32a5b11d7" @@ -22170,57 +22187,57 @@ "Story: Wait for the agent / Until the connection has resolved, Home shows only the Alpha mark": [ "7ff04e815392", "9abe6b9bf856", - "ed41e0d5b5be" + "533d587d2da9" ], "Story: Wait for the agent / Home takes input only once the facts are known, the connection has resolved, and nothing shows over it": [ "e1a0c92f2e83", "f6dac88058e2", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / The connection resolves once: connected, unreachable, offline or being recovered, each said on Home": [ "e5ed0f39e806", "54f83dda2516", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / A connection that has not resolved thirty seconds after start counts as unreachable": [ "e3b0c44298fc", "cfed74640a03", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / The connection, once resolved, stays as it ended": [ "e3b0c44298fc", "75a358561302", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / Only the connection's report or its time running out ends the wait": [ "1116aae20005", "c67941359008", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / Home, once shown, is not put behind the mark again": [ "e3b0c44298fc", "a1a380140ef2", - "a8faddd4bc66" + "b1f066dfe27a" ], "Story: Wait for the agent / The mark ends once Alpha has started, whether or not the agent answers": [ "e3b0c44298fc", "318e41ec9b29", - "a8faddd4bc66" + "b1f066dfe27a" ], "Story: Wait for the agent / Home can take input": [ "e3b0c44298fc", "859a68d34391", - "870995326b8a" + "87a35901b3ab" ], "Story: Wait for the agent / The agent can be found offline": [ "e3b0c44298fc", "cc4119d0a93f", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Wait for the agent / The agent can be found unreachable once thirty seconds have passed": [ "e3b0c44298fc", "9d27868b9def", - "a8faddd4bc66" + "b1f066dfe27a" ], "## Story: Be called up as the assistant": [ "d28d5f8e029c" @@ -22228,42 +22245,42 @@ "Story: Be called up as the assistant / The assistant surface notes each call when it arrives, and the newest replaces one not yet taken": [ "10b58bd498f2", "7e6b33deb8b0", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / A call is taken once Home takes input, and raises Ask Alpha listening only as Call says": [ "e3b0c44298fc", "3e7ec4dc78e7", - "bf91176287f5" + "332401a93db4" ], "Story: Be called up as the assistant / Close asks for the assistant surface to end, which Recovery ends once": [ "e3b0c44298fc", "58fc78fbdf96", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / Only the assistant surface, or a page not yet told which it is, holds a call": [ "e3b0c44298fc", "45ff9db87770", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / A call raises Ask Alpha exactly once, and only once the connection has resolved": [ "e3b0c44298fc", "d617cb9a16fa", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / Ask Alpha listens only for a fresh call from a trusted caller on an Alpha image, and keeps how the call came": [ "e3b0c44298fc", "4c7ebda1f7f9", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / The assistant surface can be called while Alpha is still starting": [ "e3b0c44298fc", "46ffc6f27990", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / A call can wait for the connection": [ "e3b0c44298fc", "a51edbe8d639", - "9b365c2d252b" + "e65044a46bb4" ], "Story: Be called up as the assistant / What the simulator tries": [ "89905ec87451", From 1ec768b4693a3c574cae8aa744db6b0b1ff0eed3 Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:00:37 -0500 Subject: [PATCH 21/21] Import the voice approvals journey's type-only names as types, as develop does, so lint passes on the promotion --- apps/app/test/voice-universal-approvals.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/app/test/voice-universal-approvals.test.tsx b/apps/app/test/voice-universal-approvals.test.tsx index 428eca518e..1f83796d79 100644 --- a/apps/app/test/voice-universal-approvals.test.tsx +++ b/apps/app/test/voice-universal-approvals.test.tsx @@ -5,7 +5,7 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import { Effect } from "effect"; import * as Shell from "../gen/app__shell.effect.vibe"; import * as Voice from "../gen/app__voice.effect.vibe"; -import assistant from "../src/assistant/index.tsx"; +import type assistant from "../src/assistant/index.tsx"; import { applyPendingReviewDecisions, capturePendingReviews, @@ -16,7 +16,7 @@ import { Talk } from "../src/assistant/talk.vibe"; import { CalendarReviews } from "../src/calendar/reviews.vibe"; import { SlackDesk } from "../src/slack/desk.vibe"; import { TelegramDesk } from "../src/telegram/desk.vibe"; -import { closeAll, drawn, later, only, open, underAct, until } from "./alpha.tsx"; +import { closeAll, drawn, later, only, type open, underAct, until } from "./alpha.tsx"; import { scene, type Scene } from "./fakes/scene.ts"; import { textReview, type TextReviewScene } from "./fakes/text-review.ts"; import { openAssistant, reviewProposal, speak, startVoice } from "./review-support.tsx";