Skip to content

feat: builder and browser operator agents on scheduled actions - #75

Merged
senamakel merged 53 commits into
mainfrom
teeny-builder-browser
Nov 11, 2026
Merged

senamakel merged 53 commits into
mainfrom
teeny-builder-browser

Conversation

@senamakel

@senamakel senamakel commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Teeny gets two agents that act on a schedule: a builder that writes and tests small programs, and a browser operator that works through websites. Both use OpenHuman's new per-agent scheduled_actions opt-in (tinyhumansai/openhuman#8648). This PR also bumps vendor/openhuman to 1864c68c52, which brings in #8648 and #8649.

What changes

OpenHuman bump and spine features

  • vendor/openhuman is now at 1864c68c52. The root [patch] tables are re-copied, minus the entries the spine's graph doesn't use.
  • spine/Cargo.toml adds web3 and drops tinymemes (that feature is gone upstream). It also adds legacy-import, because the core doesn't compile without it at this pin, and secret-file plus security-module. Without those last two, the file keyring and every TinySecurity path or command check fail closed with "not built into this host"; the live test showed the model key was never stored.
  • TinyComputer (the browser tool) and tinywallet are linked into teeny-spine through openhuman-modules-linked. main.rs calls install(), and the config sets [modules] overrides with source = "linked" for just those two.
  • The image now carries Chromium, fonts-liberation, bubblewrap (the builder's sandbox) and git, plus TEENY_CHROME_PATH. Compose gets shm_size: 1gb. The persistent browser profile and downloads live under state/browser/.

Core config, written at every boot (bin/lib/core_config.py)

  • Each module in bin/lib/core_sections/ owns some tables, and each table is replaced whole on every boot.
  • automation.py owns:
    • [cron] shell_timeout_secs = 1800
    • [autonomy]: enabled, full tier, workspace_only. Forbidden paths are absolute: Teeny's brain files and secrets/. state/workbench/ is the one read-write trusted root.
    • [browser]: headless, persistent profile, and unattended_actions set to click, fill, type, press, select, check and task_step.
    • [http_request] allowed_domains, read from the reviewed deploy/browser-allow.txt.
    • [modules]
  • The wallet's [wallet_policy] goes in its own module beside this one, so the two changes don't touch the same file.

Agent jobs in cron

  • bin/lib/cron_policy.py and bin/seed-cron accept agent = "..." plus prompt = "..." in place of command.
  • An agent job is rejected unless:
    • the agent is in {builder, operator},
    • it is defined in brain/agents/,
    • it sets scheduled_actions = true,
    • it names its tools, with no wildcard.
  • Agent runs are capped at 48 a day.
  • A job that changes kind (shell to agent or back) is removed and added again, because the core can't change a job's type in place.

The builder (brain/agents/builder.toml, hands/build)

  • Its tools are shell (sandboxed), the file tools and tool_search. It has no browser, wallet, connectors or token, and caps itself at 40 iterations.
  • hands/build has five verbs:
    • next claims, in order: the builder's own open claim, then the oldest picked build request, then one daily job per UTC day. It creates state/workbench/<slug>/.
    • done records the result.
    • jobs lists jobs.
    • desk (see below).
    • ship creates the repo if it's missing and pushes through hands/gh's own create_repo and push. So the guard, the owner rule, the workbench rule, the secret scan and DRY_RUN all apply. A failed ship is retried 3 times, then the job is marked failed.
  • This hand only reads build_requests. It writes back shipped or failed with a note, and only to a request that is still picked. failed is added to requests.STATUSES to match the agreed contract.

The browser operator (brain/agents/operator.toml, hands/tasks)

  • Its tools are browser, file_read, file_write and tool_search. No shell, no wallet.
  • hands/tasks add refuses a start URL that isn't on the allow list.
  • done accepts ok, failed or needs_human. A payment checkpoint ends a task as needs_human.
  • Screenshots are checked and copied to state/media/tasks/<id>/, where hands/x upload can take them.

Pinned jobs

Job Schedule Runs
builder 10 */2 * * * the builder agent
build-ship */30 * * * * bin/build-ship: hands/build desk, then hands/build ship
operator 40 * * * * the operator agent
tasks-desk */15 * * * * bin/tasks-desk

How the agents reach the hands under workspace_only

The core's workspace is brain/ and its action directory is the checkout, so workspace_only on its own lets file tools reach brain/ and nothing in state/. bin/spine grants state/workbench/ as the only trusted root and forbids Teeny's brain files and secrets/.

The agents call no hand directly. Instead they use a desk:

  • A cron shell job runs hands/<x> desk. It collects the agent's report from state/workbench/desk/<name>-done.json and passes it to the hand's own done, so every rule applies.
  • A refused report is set aside, and the reason goes on the next offer.
  • The same run then writes the next job or task to state/workbench/desk/<name>.json.
  • The agent reads one file and writes one file.

Why this design:

  • The operator has no shell.
  • A shell that could run hands/build could also run hands/gh push.
  • The file tools are ones both agents need anyway.
  • The hand that acts on a report runs outside any model turn.

I built hands/mcp first and removed it after the live test. At this pin a serve host drops every configured MCP server's tools when TinySecurity is on. tools_safe_for_agent scans with CoreContext::current_embedder_config(), which is None under openhuman-core serve, so every tool comes back scan.unavailable. The core spawned the server and listed its 4 tools, then dropped them all. This is now gap G11 in docs/oh-gaps.md, along with the fix I'd propose upstream: fall back to the loaded config.

Checks

  • bin/doctor fails if:
    • builder or operator loses scheduled_actions or its named tools,
    • the builder gets the browser, a wallet tool or an MCP tool,
    • the operator gets the shell or file edits,
    • a drafting agent (act, judge, teeny-mentions, teeny-mail) gets a tool or opts in,
    • the browser allow list doesn't parse or contains a wildcard.
  • Playbooks can't send a draft to hands/build.
  • Fixed a doctor bug where jq startswith crashed on the null command of an agent job, with a regression test (it fails on the old line).

Tests

  • python3 -m unittest discover -s hands/tests -t hands/tests: 526 tests, passing on Python 3.11. New coverage:
    • hands/build: claim order, stale claims, done rules, ship against fake GitHub with local bare remotes, the secret-scan give-up, DRY_RUN, the desk, the CLI contract.
    • hands/tasks: allow list, claims, outcomes, screenshot paths, the desk.
    • the core config writer.
  • bin/test/seed_cron_test.sh: agent jobs added, kept, updated and replaced; refused for an unknown agent, a disallowed agent, an agent without scheduled_actions, a wildcard tool scope, a missing or empty prompt, command plus agent, and the daily budget.
  • bin/test/doctor_test.sh: the posture checks above.
  • bin/test/spine_live_test.sh, run locally against a release build of this branch, all passing. It checks:
    • agent jobs seeded on the real core, and the config kept,
    • bin/build-ship laying out the desk,
    • a real builder run, built from brain/agents/, that ran as CronActions and was offered shell and file tools but no browser,
    • a real operator run, offered file tools and no shell.
  • shellcheck over CI's list, which now includes bin/build-ship and bin/tasks-desk, plus bin/doctor.

Not verified

  • Shell commands under sandbox_mode = "sandboxed" in the container: whether TinyBox's bwrap jail works under Docker's default seccomp. If it doesn't, the shell refuses rather than running unconfined, and the builder reports the job failed.
  • A real browser task end to end; CI has no Chromium.

OpenHuman pin

vendor/openhuman is bumped to f329a1476c (tinyhumansai/openhuman main). It picks up:

Checked at the new pin: cargo build --release -p teeny-spine builds, bin/test/spine_live_test.sh passes, the hands unit tests (526), the bin/test scripts and shellcheck pass. The config keys the core config writer sets ([cron] shell_timeout_secs, [browser] unattended_actions, agent scheduled_actions) still exist in the vendored schema.

senamakel and others added 30 commits November 11, 2026 01:25
Update the vendored openhuman submodule to the latest commit.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wire the spine binary up to the agent-desktop and agent-browser crates so it can drive native UI and browser sessions, pulling in the platform accessibility, clipboard, and audio backends those crates require.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Remove the patch entries for tinystoragedrivers-testkit, tinyagents-live and tinychannels, which the dependency graph never uses. Cargo records unused patches in Cargo.lock in an order that differs between macOS and Linux, so leaving them in breaks the image's `--locked` build when the lock is written on a Mac.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The spine now enables the upstream `legacy-import` feature, which the core requires at this pin to compile since `modules::tinyflows` references its flow-scope import. The comment explaining the two linked modules was also rewritten to clarify that each is the exact vendored gitlink the core was built against, avoiding contract mismatches and boot-time downloads.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The spine stores all secrets in the encrypted file keyring, but at this pin the file backend is gated behind its own feature and fails closed on the first secret without it. Enable the secret-file feature alongside the existing product set so the keyring works.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Requests can now be recorded as failed when Teeny attempts a build and cannot complete it, with the build module reporting the reason. This distinguishes genuine build failures from requests that were skipped or never picked up.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a teeny_hands.mcp package with a server module and a teeny_hands.tasks package with a cli module, along with hands/mcp and hands/tasks entry point scripts. These provide the scaffolding for exposing hands over MCP and running tasks from the command line.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The debug traceback path referenced `hand.os.environ`, which is not a valid attribute, so the check would fail instead of honouring `TEENY_HANDS_DEBUG`. Importing `os` at module level and reading the variable from it makes the debug output work as intended.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Cron jobs may now specify an agent and prompt instead of a command, restricted to a fixed allowlist of agents whose definitions set scheduled_actions and name their tools explicitly, with a daily cap on agent runs. Command validation was also tightened to require scripts under bin/ and to check that bin/act playbooks exist.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Pin three new scheduled jobs in the cron eval fixture: the builder agent that
claims and works build requests, the build-ship command that pushes finished
work to GitHub, and the browser operator agent that handles queued tasks.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new automation core section module to provide the
foundational automation logic used by the core sections pipeline.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The boot sequence now runs bin/lib/core_config.py alongside the inbound
sources, so the cron shell timeout, autonomy policy, browser allowlist,
linked modules and hands MCP server are written into the core's config
before it starts. These settings are only read at boot, so they are
rewritten on every boot.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The seeder now understands agent jobs alongside shell jobs, adding them with an isolated session and no delivery, and comparing kind, agent and prompt when deciding whether a job is up to date. A job whose kind changes is removed and re-added, since the core cannot change a job's type in place.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the seed_cron test harness to exercise agent jobs, including
prompt storage, isolated sessions, in-place prompt updates, kind
changes, and the refusals for undefined, non-scheduled, wildcard-tool,
or promptless agents. The fake cron_add now carries prompt, agent_id,
and session_target so these fields can be asserted.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The refusal case for an undefined agent now uses an agent that is allowed to run cron jobs but is absent from the brain, temporarily moving its definition aside so the check exercises the intended path.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…place lines

Agent validation now delegates to a new agent_check.py helper that also enforces the no-tools rule for the drafting agents and restricts scheduled agents to named tools, and the cron drift check recognises seed-cron's replace action so it no longer reports a false mismatch.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The doctor now parses deploy/browser-allow.txt through the websites loader so a
malformed or wildcard entry is reported as a failure. Tests were extended to
cover the scheduled agent rules and the browser allow list, and the
teeny-mentions tool-less check now looks in the agent check library.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The doctor test cases that inject extra tool entries into agent configs now
use perl -pi -e instead of sed -i.bak, since the multi-line replacements
are not portable across sed implementations.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests for the MCP server and the task queue to cover their behaviour and guard against regressions.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Cover the core configuration loading paths so regressions in defaults and
overrides are caught early.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
modules and collect now accept an optional sections path instead of always reading the built-in SECTIONS directory, so other concerns can supply their own section modules. The duplicate-table test was rewritten to use a temporary directory rather than writing into the real one, and a new test covers collecting from a separate sections directory.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The spine image now links TinyComputer and tinywallet into teeny-spine and installs Chromium, fonts, git, and bubblewrap so the browser operator and hands/gh work inside the container, with TEENY_CHROME_PATH pointing at the browser. The compose service raises shm_size to 1gb for Chromium, the live test copies the browser allowlist, and shellcheck now covers bin/build-ship.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add live checks that the seeded builder and operator jobs are agent jobs
while build-ship stays a shell job, and that the core keeps its cron
shell timeout, autonomy and MCP settings. A builder run is then triggered
against the stub model to confirm the agent is loaded from brain/agents/,
opts into scheduled actions, and is offered the shell and file tools but
no browser.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The builder tool checks now parse the offered tool names into one per line
and match them exactly, so a tool whose name merely contains "shell" or
"browser" can no longer satisfy or break the assertions. The diagnostic
print was updated to use the same parsed list.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The stub model now records each full request body so tests can inspect what an
agent was offered, and new checks confirm the core starts hands/mcp and lists
its build_next and build_done tools to the builder while withholding the tasks
tools.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Guard the jq filter against entries that have no command field so the
playbook check no longer aborts on a null value. The spine manifest also
enables the security-module feature, which the pinned build now requires
for path gating and keyring encryption.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…octor

The hands documentation now lists the build, tasks and mcp hands, explains the new B verb marker for work-queue verbs, and describes the builder and browser operator queues. The doctor test gains a case ensuring the playbook scan steps over an agent job and still checks a scheduled playbook listed after it.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Playbook drafts could previously be handed to the builder's queue and the MCP server, which belong to the scheduled agents and bin/build-ship rather than to a playbook. Both hands are now added to the not-outputs guard so a draft can no longer reach them, while queuing a browser task via hand:tasks add remains allowed.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a doctor test case asserting that a playbook whose output targets the builder's queue is rejected, so the validation rule stays covered.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 23 commits November 11, 2026 02:22
…nfig

Adds a section on the two scheduled agents that act from cron, the builder and the browser operator, and explains the per-agent exception that lets them use named tools without approval. Also updates the spine tables to reflect the new autonomy level, browser profile location and linked modules, and replaces the 120-second shell-job wall with the configurable shell_timeout_secs that closes gap G1.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…n note

Mark G1 as solved by the configurable shell timeout and add a "Landed
upstream" section covering scheduled actions and the wallet policy. The
deliberately-not-asked-for entry now scopes the objection to a blanket
allowlist, since the per-agent opt-in covers the two agents built to act.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Describe the MCP hand as a fixed catalog limited to the builder's and browser operator's claim and finish verbs, callable only from a CronActions run of those agents. Also note that tinywallet is linked in via spine/Cargo.toml while the wallet policy belongs to the wallet hand.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The README now covers the two agents allowed to act on a schedule, the
builder and the browser operator, including their cron jobs, the hands
they reach and the commands to drive them. It also explains agent jobs in
the cron config, the browser allowlist and the tables bin/spine writes
into the core's config at boot.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…olicy

TinySecurity rejects the entire policy when any forbidden path is relative, so the brain entries and `~` are now expanded and joined against the workspace root (honouring OPENHUMAN_WORKSPACE) before being written. Tests assert every emitted path is absolute.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The stdio MCP server that exposed the build and task hand verbs, along with its tests and launcher, has been deleted. The catalog and JSON-RPC loop are no longer needed now that the hands are driven another way.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The builder and operator agents no longer call hands/mcp to claim and
report work; they read their job from state/workbench/desk and leave a
report beside it. A new desk verb settles that report and lays out the
next job, so agents hold no token and reach no hand.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The agent check no longer loads the hands MCP catalog and instead verifies that each scheduled agent names the tools its desk needs, with a shared list of tools no scheduled agent may have. The doctor invocation drops the now-unused hands library argument.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
bin/build-ship now runs `hands/build desk` before shipping, collecting the builder's report and writing its next job to state/workbench/desk/build.json, and a desk failure no longer blocks shipping finished work. The builder and operator agent configs, doctor and live spine tests, and the pinned cron eval were updated to match the new desk and tool rules.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests for laying out a job or task as a desk file, collecting the report through done, and setting aside reports that are refused or name an unknown task, including the bin/build-ship dry run.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The desk's output is now redirected to stderr, keeping stdout reserved for the ship itself. A comment was added to explain the split, since a desk that fails must still not stop finished work from shipping.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The live spine test now waits for the builder's model request to appear before asserting on its offered tools, and the helper that reads that request is defined earlier so the wait loop can use it. This avoids racing the tool check against the request being recorded.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the README and architecture docs to show the builder and operator agents reading their jobs from and writing their reports to desk files, with bin/build-ship and the new bin/tasks-desk collecting those reports, replacing the hands/mcp claim and finish verbs.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The boot comments in bin/spine now describe the core settings as covering the workbench the scheduled agents' file tools reach rather than the hands' MCP server, and docs/hands.md gains a row for the mcp hand, a stdio MCP server exposing only the read-only verbs.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Expands the deployment README with operator notes on where the browser may go, where the builder and operator queues live, and how to find work left for a human. Also clarifies in the env example that builder output only ships via `hands/build ship` and only with `DRY_RUN=0`.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored openhuman submodule to the latest commit so the project tracks the upstream changes.

Auto-committed-on: macbook
Updated the socketioxide stack to 0.18.9, which pulls in the new engineioxide-core crate and moves matchit, sha1, and thiserror to newer major versions. Bumped the tinywallet crates to 0.29.0 and removed a stale build log that recorded a failed --locked build.

Auto-committed-on: macbook
Append the latest build output, covering the openhuman crates and teeny-spine compilation along with the openhuman lib warnings.

Auto-committed-on: macbook
Gap G11, which dropped every configured MCP server's tools when TinySecurity was on, has been fixed upstream in openhuman#8654, so the docs no longer describe MCP as blocked. The architecture and hands notes now say the MCP hand is unblocked but not yet built.

Auto-committed-on: macbook
Appended the release build completion line and exit status to the build log, capturing that the optimized build finished successfully.

Auto-committed-on: macbook
Delete the captured cargo build output that was accidentally committed; it is a generated artifact and does not belong in version control.

Auto-committed-on: macbook
# Conflicts:
#	README.md
#	docs/hands.md
#	hands/lib/teeny_hands/requests.py
Keeps both sides: the builder, build-ship, operator and tasks-desk jobs beside
bounty-pay (24 jobs, the policy's ceiling), the build output ban beside the
money-hand rules in bin/lib/playbook.py, and both sets of hands in the docs.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 74640dc into main Nov 11, 2026
3 checks passed
@teenydroid
teenydroid deleted the teeny-builder-browser branch November 11, 2026 10:09
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