small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
README.md

UI review kit #

Use this kit to inspect the web client through a private daemon, seeded chats, a local fake provider, and an owned Chrome browser. Drive it from an Albedo Python kernel. It is an opt-in manual workflow, outside the test gate.

seed.py owns seed creation. kit.py owns each running review and its browser. Follow the repository's private-daemon and UI review rules and the web client guide.

Prepare a base #

Use the checkout's development shell. Build the CLI before seeding:

nix develop
export ALBEDO_UX=/tmp/albedo-review
export ALBEDO_NO_BROWSER=1
go -C cli build -o bin/albedo ./cmd/albedo
python3 test/manual/ux/seed.py

Install Chrome separately if it is unavailable. The browser binding finds an installed browser, rather than downloading one. Run the Python examples below in an Albedo kernel, where the albedo tool bindings exist, rather than in standalone Python. Set the same ALBEDO_UX in that kernel's environment before importing kit. Its base path is fixed at import time. seed.py --base PATH can also select a base, but does not set the kernel's environment.

Seeding builds a daemon snapshot in daemon/, a web build in dist/, two Git workspaces in ws/, and a home in seed/. It creates chats covering markdown, code, tables, thinking, tools, file edits, and failure. Seeding replaces these builds, workspaces, and the seed home. Repeat it after daemon changes. For a web change alone, use a separate build as shown below.

Reviews hold a shared base lock. Seeding requires an exclusive lock and refuses bases with unfinished .active run markers. Do not reseed while reviews use the base. Workspaces are shared across its runs: a fresh home does not undo file edits. Use separate bases for reviewers who need independent workspace state.

Start, inspect, and stop #

Choose a new run name for every review. Existing names are rejected, including stopped runs, so their screenshots and homes are preserved.

import sys
sys.path.insert(0, "test/manual/ux")
import kit

ui = await kit.start("sections-review-001", width=1440, height=900)
try:
    print(kit.scenarios())
    await ui.load("sections")
    print(await ui.windows())
    print(await ui.layout())
    await ui.shot("sections-wide", show=True)
    print(await ui.errors())
finally:
    await ui.stop()

start() copies the seed home into runs/NAME/home, disables standby daemons, and starts a fake provider, web server, daemon, and browser page. It attempts cleanup if startup fails. Screenshots go in runs/NAME/shots/. shot() returns a path. Use show=True or show_image(path) to inspect the image.

stop() attempts browser closure, both CLI stop commands, every owned job, and a scan for processes carrying this run's ALBEDO_HOME. It waits for observed home-matching processes to exit. It raises if a cleanup step or scan fails, or processes remain. An empty result means those cleanup steps completed. The home scan does not independently discover Chrome; its owned browser handle performs that cleanup.

A failed cleanup leaves the .active marker and retains the base lock while the Review remains alive. Retry await ui.stop() after investigating. If the kernel exited or startup failed without returning a handle, inspect the run's processes and stop them under its environment before removing the marker. Verify browser shutdown separately. Never remove a marker or run directory merely to bypass the guard. Archive or remove old evidence only after verifying its resources have stopped.

To inspect a different web build without replacing the base's build:

from pathlib import Path
candidate = await kit.build(Path("/tmp/albedo-web-candidate"))
ui = await kit.start("candidate-review-001", dist=candidate)
try:
    await ui.load("sections")
    await ui.shot("candidate", show=True)
finally:
    await ui.stop()

kit.build() refuses web/dist, which may be serving another client.

Drive the page #

Windows are named w0, w1, and so on in board insertion order. windows() returns their current header points (head) and rectangles (box) in CSS pixels. Derive gesture coordinates from these values after layout changes:

source = await ui.window("w1")
target = await ui.window("w0")
print(await ui.drag(tuple(source["head"]), tuple(target["head"])))

For a drop preview, use hold(point), probe(x, y), and release(x, y). palette(command) runs a command. say(window, text) sends a chat message. mark() followed by remounted() reports window elements recreated since the mark, which helps inspect whether a move preserved mounted content.

  • key() sends US keyboard events. key("!") and key("1", kit.SHIFT) produce Shift-1. Use type(text) to insert text and key("Backspace") to delete. key("a", kit.META) selects all in an editor. say() targets the contenteditable composer.
  • click() hovers first and waits 80 ms between press and release. This is the kit's gesture timing for controls that ignored a bare CDP click during manual review, rather than a browser-wide timing requirement.
  • Scenario builders check for tiles at least 160 px wide and high at 1440×900. Preserve that scenario constraint. Production docking refuses splits that would squeeze tiles below their minimum. Tab joins are exempt.
  • A floating note dropped over another float targets that float rather than the canvas beneath it.

Understand resets and errors #

load() builds or restores a cached scenario by replacing all localStorage and reloading. It can discard unsent board notes and other browser-local state. Messages already sent remain in the daemon. Start a new run for a fresh home. Cookies are separate: a theme chosen in settings or through the palette still wins over media(dark=True) until palette("theme: system").

errors() returns errors, unhandled rejections, console errors, and stale-tether records from the current document load. Listeners are installed on each new document, but the records reset on navigation. Capture them before reloading.

The kit enables the tether audit. At rest, every 500 ms it compares rendered lines with freshly computed geometry and records differences. This checks resting geometry, rather than every frame or every possible tether defect.

Run focused checks #

Use disposable review runs for checks that change settings or boards. Read the helper before using it to understand which state it changes.

  • settings_check.py: await settings_check.check(ui) exercises focus, categories, drafts, saves, resets, stale edits, persistence, and phone fallback.
  • extensions_check.py: run after the settings check. It exercises global extension toggles, saves, stale writes, and dependency refusal without creating a session. It does not check confirmation cancellation.
  • tethers_check.py: runs movement and layout flows and checks new stale-tether records after each board's initial settle. Inspect initial errors and ordinary page errors separately.
  • artifact_touch_check.py: exercises artifact touch behavior and changes preferences and boards. Use a disposable run.

replies.py selects fake responses by message content. Examples include slow or hung replies, failures, tools, jobs, agents, edits, tables, long text, and artifacts. Matching is ordered: the first matching branch wins. Read it when choosing a trigger, especially for messages containing several keywords. It is the canonical response list.

Give a reviewer a bounded brief #

Assign an area, starting scenarios, and interactions to try. Reviewers inspect and report without editing the checkout. Give each reviewer a unique run name and require cleanup in finally.

Write one report artifact and hand back its link. Include:

  • Checkout revision, daemon snapshot and web build used, base and run paths, scenarios, viewport, theme, and time spent.
  • Findings in priority order: exact steps, observed and expected behavior, screenshot paths, and confidence. Distinguish broken behavior, confusing interaction, visual defects, and preference.
  • Reproduction attempts and results. Try to reproduce a finding, but report intermittent failures with the evidence available rather than suppressing them until they happen twice.
  • What worked, what was outside scope, and setup limitations.
  • Cleanup outcome, including errors or remaining resources.

Inspect screenshots before citing them. Preserve them with the run so another reviewer can assess the finding.