Skip to content

Merge dev: whole-project review fixes, socket auth and driver build - #558

Merged
JE-Chen merged 240 commits into
mainfrom
dev
Nov 27, 2026
Merged

JE-Chen merged 240 commits into
mainfrom
dev

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Nov 27, 2026

Copy link
Copy Markdown
Member

Merges dev into main: 237 commits since #557 (2026-11-19), recorded as U-20261119-01 through U-20261127-07 in docs/updates/. main holds only version bumps and merge commits that dev lacks, and the merge is clean.

What is in it

  • Whole-project review and fixes. The servers and executor, the GUI, the platform backends, every utils/ subpackage, remote desktop and USB, and the agent runtime were reviewed, and the follow-ups were closed. A line-by-line read of every executor adapter fixed 17 bugs, for example "false" flags read as true. The 28 findings of the 2026-11-27 review in code-review.md are fixed: recording, signing, shell secrets, the browser extension, the web viewer, Docker/Helm, native services, the LSP and smaller items.
  • Security.
    • The TCP socket server requires authentication (AUTH <token>, owner-only token file, RBAC roles, --no-auth to opt out).
    • Secrets passed as positional arguments are masked.
    • Voice commands and macros run only where both the registrant and the caller are allowed.
    • Generated documents keep ${secrets.X} as references.
    • The browser extension never records password or other sensitive field values.
    • The Docker remote-host mode refuses a missing AC_TOKEN.
  • Stopping a run. A stop now also ends adb, mobile device and find-element calls, the USB and Wayland capture tools, AC_wait_for_port, AC_send_email, AC_feature_match, each agent model call, the media assertions and admin poll/broadcast. Accessibility writes stop before they act.
  • GUI.
    • Background work is off the GUI thread, including per-frame decoding, TLS loading and file/store I/O.
    • Tabs check RBAC and token fields are masked.
    • State texts and table cells follow a language switch.
  • Remote desktop.
    • Connections still authenticating no longer take viewer slots.
    • H.264 viewers that fall behind resynchronise on a keyframe.
    • Per-viewer send queues.
    • The web viewer's input now reaches the host.
  • Agent runtime and native.
    • Desktop read-only verification works.
    • The native memory and UIA fixtures were run on Windows.
    • Wayland captures are bound to their operation.
    • Android helper fixes: gesture failure, client isolation and a non-reusable fence generation.
  • Driver. The socket driver is built in CI with Nuitka: a windowless Windows exe and a Linux binary, smoke-tested for authentication and attached to releases. The stale committed binaries are removed.

Compatibility changes

All are listed under Unreleased in CHANGELOG.md.

  • Socket server. Clients must send AUTH <token> first, or the server must be started with --no-auth.
  • Agent task payloads. ${...} in AC_agent_task_* / AC_agent_dag / trigger / skill / recovery payloads is expanded by the runtime against the task's inputs, not at dispatch.
  • Image search and foreign errors.
    • Unusable image input raises ImageSearchInputException, and absence checks fail on it.
    • cv2.error, sqlite3.Error and plugin exceptions are recorded per action as AutoControlForeignException.
  • Executor flags and arguments.
    • Flags spelled "false" are honoured by AC_usb_passthrough_enable, AC_usb_acl_add, AC_assert_visual, AC_execute_action(dry_run=...) and others.
    • List arguments given as a JSON string must decode to a list.
  • Device timeouts. A timeout of 0, a negative number, NaN or infinity raises DeviceError.
  • Docker. remote-host needs a non-blank AC_TOKEN, and AC_PORT applies in every mode.
  • Browser extension. Sensitive fields export as ${secrets.NAME}, and recording follows only the starting tab.
  • VS Code / LSP. Only files matching autocontrolLsp.actionFiles are diagnosed.
  • Generated projects. Executor scripts find keyword/ relative to themselves, so projects created earlier need regenerating.

Verification

  • Dev CI, the quality workflow (lint, security, typing, docs, free-threaded, the test matrix), the Driver workflow and the Android helper workflow ran on dev during this work.
  • Not verified in a real environment:
    • Docker images (no image build here).
    • The VS Code extension's TypeScript (no workflow builds it).
    • The web viewer and browser extension in a real browser. Both were run in Qt's JavaScript engine with fakes.
    • The device, Mac, Linux-native and paid-API acceptance that Progress.md lists.

A helper assigned to its kill-on-close Job after Popen returned was
already running and could spawn a child outside containment. Start it
with CREATE_SUSPENDED and resume its sole primary thread only after the
Job assignment succeeded.
Non-ASCII service keys were refused outright, so such services had no
same-service lock. Fold them with the NT upcase table registry keys
compare with, never Python's case mapping, and keep the ASCII digest.
opencv-python 5.1.0.95 ships a cp37-abi3 win_arm64 wheel, so the marker
that kept OpenCV and je_open_cv off that platform now only costs image
matching. cryptography stays marked off until it ships one at our floor;
the arm64 smoke square now runs cv2 template matching itself.
Click intervals, tween-drag rests and humanized motion/typing delays
slept with plain time.sleep, so a stop had to wait them out. Route them
through run_control.pause, which is still time.sleep outside a run.
Memory and UIA sources already fed the shared observation report; DOM
state did not. Browser profiles can now declare reviewed fields, read
through the managed session as a context-bound source with per-field
reasons, published without capture metadata so fingerprints still match.
DAG action files, suite data files and assertion template/file paths sat
inside objects declared as bare objects, so configured path roots never
looked at them. Declare those keys as paths so the existing walker
confines and canonicalises them.
The presence broker reads its fd 4 nested grant since d7e7619 and every
helper entry point starts parent_watch; only native verification of the
rest remains.
macOS presence sources had no transport, so the non-Windows presence
chain stopped at Linux. Name the connector by its audit token, pin it
with a kqueue exit watch and its boot-unique id, and frame a Unix stream
under the shared lease owner; endpoints carry their platform shape.
A host adb input command cannot be fenced once sent, so a takeover or
cancellation could not stop an old writer. Lease a fresh device epoch
per command, send it with the helper's begin, settle from the helper's
own account, and treat any getevent event as physical takeover.
iOS had no RemoteDeviceAdapter, so managed iOS work had no entry point
at all. Read only foreground-app metadata, refuse stale calls, and since
WDA cannot fence old writers, require a trusted provider and its own
device-side writer rather than calling WDA directly.
The emulator console accepted the key event but produced nothing on
evdev, so the positive control could not tell a blind source from a
working one. Write the key to each evdev node when the console's event
does not appear, and print the device list.
A model round trip can take tens of seconds and the three VLM locators
called it directly, so a stop waited it out. Route them through
stoppable_call as template matching and OCR already are.
The emulator exposes only virtio multi-touch evdev devices, which drop
key codes, so neither the console key nor a sendevent key reached
getevent. Write one multi-touch contact instead.
The shell user may read evdev nodes but not write them, so the positive
control's sendevent was refused. The AOSP emulator image allows adb root.
The handshake accepts only 32-hex generations, so the server refused
'gen-1' and closed the socket before the client could read its peer.
Record the intermittent Windows transfer-import timeout seen meanwhile.
Wayland had no trusted presence source, so its sessions could never tell
a person from injected input. Read kernel evdev devices directly, leave
out every virtual (uinput) device, and refuse to start without access.
Driving local-model tasks against a loopback Ollama-shaped server showed
a refused connection escaping run_task as a raw URLError. Map non-framework
worker failures to AgentTaskError, keeping the original as the cause.
A UIA walk of a busy desktop can take seconds and a stop waited it out.
Run reads on one long-lived thread, which keeps one COM apartment, and
let a stopped caller stop waiting; writes stay on the caller's thread.
The helper-backed provider had no entry point a host could register.
Add an android profile with closed settings and one package, built into
a remote target that runs a fixed worker wiring the helper, the getevent
source and the adapter.
Every UIA test used a fake comtypes and the package never declared the
real one, so nothing showed the backend working over real COM. Add the
Windows-only accessibility extra, a Windows job running read-only real
COM tests, and route system_volume's COM setup through the same path.
The capability recovery text tells users to reset the native session
after a portal refusal, but no command, tool or GUI action could. Add
reset_native_input with AC_, MCP and Diagnostics surfaces; it retires
the cached session and refusal and requests nothing itself.
The portal-close, compositor-disconnect and device-removal states exist;
what remains is native acceptance, an upstream restore-token gap and an
undefined capture binding that needs the maintainer's definition.
WebDriverAgent offers no install, files or recording, so those iOS
commands could never work. For Simulators, run xcrun simctl behind the
MobileExtension contract, registered per UDID and layered over WDA.
On a loaded runner a bounded reply outlived the 3 s test client timeout,
and teardown closed the runtime while the import worker was still
retiring. Wait longer for replies and close once the worker lets go.
Three commands were added without regenerating actions.pyi, so every
Dev CI square has failed since e94c98a.
The Wayland source left out Bluetooth devices and skipped ones it could
not read, so a person could look absent. Also keep one hung accessibility
walk from blocking later reads, and let an unconfirmed device fence
refuse later leases as documented.
A portal capture can outlive its task's authority. Also close the gaps
left in the evdev and accessibility walker corrections: an older key-up
could clear a key the kernel reported down, and a moved read that hung
was never retired.
The mapped headers were compared byte for byte with the file, so every
observation of a real process was refused. Found by the first native run
of the owned memory fixture, whose page layouts also refused the
read-only snapshot their runner requires.
The REST server routes /screenshot for GET only, so the extension's POST
got 405 and never reached the handler. Even a successful reply was thrown
away: the command only said "captured". Now it decodes the base64 PNG,
writes it to a temp file and opens it, and shows the status and body of a
failed reply. The test drives the extension's method and path against a
real RestApiServer with a stand-in image.
The LSP read only event_dict, so every flow block command registered
apart from it (AC_sleep, AC_loop, AC_if_var ...) was flagged unknown and
missing from completion, and it rejected positional list arguments the
executor dispatches as event(*params). Commands now come from
known_commands(), params follow the executor's rule (object or list, an
object only for a block command), and the auto_control wrapper is
accepted. The project's keyword examples are the contract test.
The client selected every local JSON and JSONC file and the server
diagnosed each as an action list, so package.json got "root must be a
list" and a commented settings file got JSON parse errors. Action files
are now chosen by the autocontrolLsp.actionFiles globs (default
**/*.ac.json and **/actions/**/*.json): the client builds its
documentSelector from them and passes them as the actionFiles
initialization option, and the server checks each URI against the same
globs before diagnosing, so other clients are guarded too.
LSP clients count character offsets in UTF-16 code units, but the store
used them as Python indices, so every emoji or other non-BMP character
before the cursor shifted it one place right: hover on such a line found
no word, and incremental edits landed in the wrong place. Positions are
now converted where they enter the store, and a column past the line
end stops at that line instead of running into the next one.
Both entrypoints fell back to a fixed token when AC_TOKEN was unset, so
every container started that way shared one publicly known credential on
an interface bound to 0.0.0.0. A missing or blank token now stops the
container before Xvfb, the VNC server or the host start.
The images installed only the base wheel, so FastAPI and Uvicorn were
missing, and both entrypoints passed --host, which the signaling parser
rejects in favour of --bind. Build and install the [signaling] extra and
pass the flag the parser accepts, leaving the server's CLI unchanged.
A custom rest.port or signaling.port moved the Service and containerPort,
but the entrypoint kept listening on 9939 and 8765, so the Service pointed
at a closed port. The entrypoints now read AC_PORT in every mode, as
remote-host already did, and both Deployments set it from values.yaml.
The builder stages copied neither je_auto_control_pytest.py nor LICENSE,
and .dockerignore dropped LICENSE from the context, so the image's wheel
declared a pytest11 entry point for a module it did not contain and
shipped without its license. setuptools only warns about both.
…heir high bits

Without argtypes ctypes passed WPARAM and LPARAM as C ints, so a value over
32 bits did not convert, and read LRESULT as a 4-byte long. The prototypes sit
on a private user32 handle so the function objects other modules share are
left as they were.
NaN and infinity passed DeviceContext and disabled the deadline check in
DeviceSession.invoke, so a stalled SDK call was waited on forever; an
explicit 0 from a spec or a command was silently replaced with 30 s; and
an invoke override was never checked. Each is now a DeviceError, raised
before a worker thread starts.
It printed the authenticated reply and the driver's exit code and returned 0
whatever they were, so a driver that answered with an action error or exited
with code 9 still passed the release check. The reply, the quit_server answer
and the exit code are now checked, and a failure exits 1 after printing them.
The generator baked the creation-time keyword path into each script and the
committed examples held a path on the author's machine, so a moved or cloned
project read keyword files from a place that no longer had them. The scripts
now find keyword/ beside their own folder, and the committed examples are
exactly what the generator writes.
The overview still claimed an unconfigured gate loads any package with a
DeprecationWarning; the gate has refused every load before importing since
the allow-list landed. It now states that default and the three ways to
allow a package, matching the setup guides.
stop_record() turns a backend failure into an empty list, and record_to_json
saved that list over the user's file while the CLI reported success. The file
path now stops through a helper that raises, so the existing file is left
byte-identical and the CLI exits non-zero; a clean stop with no actions still
writes [].
…ted executors

With JE_AUTOCONTROL_REQUIRE_SIGNED_ACTIONS set, the Record tab parsed a loaded
file with read_action_json and playback ran it from memory, and the generated
single-file executors read their action file the same way, so an unsigned or
tampered file still ran. Both now read through read_executable_action_json,
which verifies the bytes it parses; playback runs that verified list.
The reader threads queued stdout and stderr in plaintext, and the queue was
only logged when a later exec_shell or pull_text drained it, by then under
another run's mask or none. A program printing a value its run had resolved
after the run ended put that value in the log. Each reader now retains its
run's mask until its stream ends and masks every line before queueing it;
the mask forgets its values once the run has closed and the last holder is
done. Output logging stays on, so AC_shell_command output is still visible.
…control

start ignored a five-second wait timing out, and stop returned at once when
the worker had no thread id yet, so a slow worker installed the hooks and
pumped messages after recording had stopped. The PostThreadMessageW result was
not checked and the events were handed over while the thread could still
append. The hook now keeps its thread and a stop event, fails a start that
times out, gives the thread a message queue before publishing its id, raises
when the thread does not exit, and returns a snapshot only after it has.
Win32InputHook now owns its thread as an optional attribute and joins it in
stop, so PresenceHook narrows the thread before using it, maps a hook that
did not exit to AgentTaskError as before (keeping its one-second bound), and
tells a worker that came up after a failed start not to pump.
…s them out

The executor templates find keyword/ from their own location and read
through the verifying reader, so both tests build an executor/ and keyword/
pair and stub read_executable_action_json.
ctypes.WINFUNCTYPE exists only on Windows, so the window-message test
failed to collect on Linux and macOS. The Windows 3.11 runner's
setuptools predates the license-files the wheel test builds with; it now
skips below the declared floor and shows the build's stderr. Quick
Connect fills its Recent list after the off-thread write reports back,
so the test waits for it. Inside the image the signaling extra is now
installed and starlette refuses to load its test client without an HTTP
client package; those three modules skip with the reason instead of
erroring.
The LSP glob tokenizer's last alternative could only ever match a lone
'{', so it now says so; the Wake-on-LAN path tested its entry twice; and
the runtime install, which takes only the builder's wheels with no
index, carries the review note on the line Sonar flags.
The Docker image now includes the signaling extra, so the config-sync and
signaling tests no longer skip inside it, and starlette 1.x builds its
TestClient on httpx2. Pinned as a test-only dependency; the package
itself is unchanged.
@sonarqubecloud

Copy link
Copy Markdown

@JE-Chen
JE-Chen merged commit 149187f into main Nov 27, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant