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/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/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/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/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/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"]]); 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/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 ca7a3aaf81..169a1a0e02 100644 --- a/apps/app/test/image.test.ts +++ b/apps/app/test/image.test.ts @@ -636,28 +636,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/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/apps/app/test/reminders.test.tsx b/apps/app/test/reminders.test.tsx index f890493e5f..b4d45a2a10 100644 --- a/apps/app/test/reminders.test.tsx +++ b/apps/app/test/reminders.test.tsx @@ -633,9 +633,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 = { 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/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/apps/app/test/voice-universal-approvals.test.tsx b/apps/app/test/voice-universal-approvals.test.tsx index 6c566034b9..1f83796d79 100644 --- a/apps/app/test/voice-universal-approvals.test.tsx +++ b/apps/app/test/voice-universal-approvals.test.tsx @@ -3,12 +3,9 @@ // 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"; +import type assistant from "../src/assistant/index.tsx"; import { applyPendingReviewDecisions, capturePendingReviews, @@ -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 { 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"; 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/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/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", diff --git a/packages/cli/test/cli.test.ts b/packages/cli/test/cli.test.ts index 11ecdbc70f..11111ac16a 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/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; 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()] }); 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"]) 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",