ADR-029: Profiled browser interactions
Status: Accepted target on independently reviewed merge to develop.
Capability availability and remaining boundaries are owned by STATUS and the
Current App Guide.
Decision class: Target architecture
Tracked work: #1012, exact Forgejo forms #1013, under #992.
Context
The public browser v1 permits only navigation and extraction. ADR-018 and
ADR-021 permit fixed authenticated profiles, not arbitrary DOM writes. Typed
interactions need current document identity and effect-aware transport authority.
This decision extends those boundaries through a separate browser.interact.v2
capability; v1 and existing authenticated profiles retain their contracts.
Decision
Only server-registered, reviewed site profiles may execute v2. A profile binds its version, exact origins, document/schema constraints, supported actions, request paths/methods/body digests and explicit effect classification, including GET. No caller script, CSS selector, cookie jar, credentials or arbitrary URL becomes executable authority. Model output remains untrusted input.
Initial public profile is httpbin.forms.v1, the static public HTTPBin
multi-field form at https://httpbin.org/forms/post. Preparing values is local,
with JavaScript disabled and all network denied after the exact approved document
read. Its /post echo submission is blocked in this milestone. A separate reviewed
exact effect must bind native approval and request-body identity before the event.
This profile grants no pizza-order,
payment, account or business-object authority. Production availability and useful
third-party business workflows are not established by local acceptance.
Primary source inspected 2026-10-08: official form template and official request handlers. These establish the candidate grammar, not deployment version or effect-free GET. Source drift blocks the profile rather than guessing the current site's behavior.
The registered production document pins SHA256
d9cd9adbe7554d4e82a597d722dccdcea70c8dd918836670e3f9687531f54d74
from the official HTML receipt retained on 2026-10-08 (1,397 bytes, HTTP200,
text/html, no redirects). Only one main-frame GET of that exact URL is admitted;
status must be 200, content type text/html, zero redirects, no Set-Cookie or
Location, response at most 65,536 bytes. The existing
request_pinned_https ceiling and zero-redirect/pinned-address/normal-TLS
contract are enforced before browser fulfillment. The adapter rechecks source
digest and response bytes. New upstream bytes require a reviewed profile version.
Tests use a constructor-only fixed local source fingerprint, never a user/API
source-digest setting or production loopback allowance.
Current DOM state is at most 65,536 bytes, accessible nodes at most 64, serialized snapshot at most 32,768 bytes, each node name at most 256 characters, each private field at most 2,048 UTF-8 bytes, and literal preview at most 16,384 bytes. Unknown or oversized content is blocked before publication. POST body ceiling is zero here because every POST is denied, including the profile's otherwise known /post route. A future exact form effect must declare and enforce a finite request-body ceiling (no more than the existing 16,384-byte transport ceiling); it is not activated by this decision.
Typed page state and actions
PageSnapshot contains URL, origin, document digest, captured time and bounded
accessible nodes with opaque node IDs, role/name and supported actions. IDs are
generated by the trusted snapshotter and bind current document revision. Every
action checks the current origin, live document revision, node uniqueness,
profile permission and current original owner/Root/Goal authority. Drift or
ambiguity returns a new-snapshot requirement, never guessed interaction.
BrowserAction.v2 supports navigate, extract, click, fill, select, check and
bounded wait with locator_ref, expected_page_revision, and private
input_value_ref. At most 20 actions, five explicitly approved origins, 180
seconds and one existing browser lane apply; no parallel queue is introduced.
All unknown click/fill/select/check handlers are effectful. Preapproval edits are permitted only in a registered adapter enforcing no-egress preparation. Any network requirement first needs exact effect authority. Request interception is installed before navigation and DOM execution. Requests not matching the current exact origin/path/method/body digest/phase are denied. Preparation denies all requests, WebSockets, service workers, popups and downloads. Network authority is checked again at the pinned transport handoff; route.continue is prohibited. No caller-supplied evaluated script is accepted; trusted fixed snapshot code is the only DOM introspection code.
Durability and recovery
Reuse current Python lifecycle, durable jobs, native approvals, private artifacts, effect receipts and browser resource ownership. Explicit start/stop owns contexts; imports launch nothing. There is no future bridge import, ownership table, composition epoch or duplicate authority/cost ledger. Later A1.2 integrates these typed callables into its sole canonical lifecycle bridge.
Persist redacted action intent before execution and result/blocked metadata after
execution. Generic journals exclude input values, passwords, cookies and tokens.
Exact preview values live only in permission-checked private artifacts. Reload
shows action history without restoring input authority. Reopening a permitted
page compares current state; uncertain events are never automatically re-clicked.
Lost cleanup keeps the browser lane quarantined until positive owned-resource
closure; process absence is not proof. Outcome includes explicit no_learning.
Recoverable admission requires the current Root's existing canonical ownership
enrollment and a live, unrevoked OperatorIdentity; absent binding blocks before
job admission or contact. This uses the existing operator ownership controls,
never automatic enrollment or a browser-specific owner table. Record the exact
native physical reservation in the existing job journal before launch, with the
original job/attempt/fence/input/authority identity and the same lane inode's
workspace identity, process/context nonces and an actual native kernel boot UUID.
The immutable witness is staged only in memory under the original lane flock.
Commit the typed canonical reservation, then write and fsync the positive marker
on that same inode, then enter the browser driver. A crash before the marker
leaves read-only unresolved job history; exact request replay never retries or
infers no-child proof from an absent marker. No browser can launch before both
records are durable. An original initialized runner that never entered launch
may prove owned_no_child; callers cannot supply that assertion.
Physical cleanup and durable job outcome remain distinct. Actual awaited owned closure is completed outside the canonical writer. Its exact positive witness stays in the required lane marker until a typed physical-only journal receipt commits. Failed receipt CAS retains the witness and reservation, so later jobs cannot overwrite the only cleanup proof. Explicit reconciliation uses the current authenticated Root's same stable canonical identity, derived through the original immutable session relation. It does not require or renew old Goal execution authority. A bounded local callback rechecks the exact retained witness under the lane lock inside the writer; it performs no network operation or cleanup wait.
After owner-process loss, only a changed valid actual native kernel boot UUID
proves all resources from the original boot are dead. Same boot, missing or
unreadable boot identity, changed workspace/lock inode, wrong job or mismatched
reservation fail closed. Recovery therefore requires an operator-managed
reboot when original positive closure is unavailable. No PID kill, process
absence, elapsed time, unlocked descriptor or generic IPC is a cleanup proof.
Linux reads only /proc/sys/kernel/random/boot_id. Darwin reads only the
verified read-only kern.bootsessionuuid through the fixed system library and a
37-byte UUID buffer. The schema records boot_platform and boot_session_id;
proof kinds are linux_boot_changed and darwin_boot_changed. Unknown platform
or unavailable native boot proof blocks admission before any browser starts.
Darwin native execution remains unverified on this Linux test host. The
read-only boot sysctl registration and boot-cycle semantics were independently
verified on 2026-10-08 against official
XNU kern_sysctl.c
and Apple IOPM.h.
Cleanup-only discovery exposes only same-stable-owner job identity, physical
proof state and unchanged durable status. It exposes no old session, Goal, URL,
page nodes, history or preview. The explicit typed cleanup endpoint accepts only
acknowledgement, deriving the original witness and job binding on the server.
A genuinely attempted unverified close retains canonical
unknown_external_effect, or running if original authority no longer permits
that transition; the UI projects blocked readiness separately.
Its journal receipt preserves original durable status, leases, external-effect
uncertainty and outputs. It cannot adopt a result, grant success, retry actions,
reconcile external effects or transfer the original history authority. Exact
receipt replay deduplicates without releasing any later resource reservation;
conflicting cleanup proof fails closed.
Exact authenticated Forgejo profiles
Only forgejo.issue-create.v1 and forgejo.issue-comment.v1 extend the
ADR-021 title owner. The original title
transaction and its 245 UTF-8-byte title limit remain unchanged. These profiles
use the existing Python connection, Vault, canonical jobs, native approvals and
browser lane. They grant no generic authenticated interaction, API write,
credential import, token creation, attachment or third-party site permission.
Availability is an additive connection-owned, closed canonical schema with a compiled Forgejo 15.0.9 version and reviewed source-manifest digest. The empty profile set is the default. An explicit unchecked consent may activate at most two sorted unique IDs, comparing connection and form-profile revisions under the original Root's serialized writer and current Vault binding. Availability grants no POST. Reauthentication, credential replacement and local revocation clear availability and advance its revision before any provider contact.
Preparing an ordinary issue binds the exact query-free owned repository form;
preparing a comment additionally reads the exact numeric ordinary issue. Unknown,
duplicate, prefilled, template, status, file and attachment controls block the
selected operation. Fixed profile adapters accept only the pinned native
successful controls and ordinary unnamed submitter. A source or native DOM
contradiction blocks the affected adapter until independently reviewed source
evidence resolves the contract. JavaScript stays disabled during preparation and
submission. Backend-only web cookies reach exact web paths; Vault-derived Basic
credentials reach numeric API GETs only. Native Chromium Origin, Referer and
frame are required at transport handoff. Chromium's request-stage interception
runs before its network service adds Fetch Metadata, so the paused native POST
carries no Sec-Fetch-Site. A present value must be same-origin; a missing one
is forwarded as missing and never synthesized. Forgejo's unmodified Go
http.CrossOriginProtection then accepts the request because the backend
transport sends the browser's Origin to the matching Host, so it is not an
independent control here. The control is confinement: only the trusted backend
transport holds the session cookie, and it forwards nothing but the one approved
native POST, validated against the exact path, body and reviewed digests, from
the scripts-disabled page Seraph itself served. This matches the #925 title
profile. Requiring a genuine Sec-Fetch-Site at handoff needs a separately
reviewed transport stage and remains a follow-up. No synthetic CSRF token is
created. Cross-origin and challenge responses fail closed.
Both authenticated profiles launch Playwright's pinned Chromium with its own
sandbox enabled (chromium_sandbox=True). A host that cannot provide the
sandbox fails the launch and the job blocks; there is no fallback to
--no-sandbox. The public read-only lane keeps its existing launch.
The initial signed 15.0.9 source signature is separate from native HTML5 form ownership. It pins the complete selected source structure, source form ancestry, the exact nested branch stub, inactive controls and inert editor template. The create native inventory has exactly 29 controls and successful names in order: title, content, ref, edit_mode, search, label_ids, milestone_id, project_id, assignee_ids. Only title/content change to reviewed literals; other values stay blank except the pinned page-derived edit_mode. The source redirect_after_creation input must remain empty and natively unowned, and never enters the POST. The no-project variant remains blocked. Comment has exactly 21 native controls and only content is successful; its separate status and editor controls remain unactivated. Both ordinary submitters require unique exact identity and ancestry. The lexical script inventories are create four/comment five; both active native inventories are four, with the fifth comment script inside the pinned inert template. No script or template is activated, ignored or synthesized. Only typed original actor/repository/numeric issue/title slots may vary; source or ownership drift blocks instead of broadening the grammar.
Exact private review binds account and numeric repository/issue identity, literal
title/body, native control order, source/form/body digests, ordinary notifications
and history, and one POST. The content field for these two profiles may contain
at most 16,384 UTF-8 bytes; the generic 2,048-byte private-field bound remains
unchanged for every other profile. The complete escaped form is at most 16,384 bytes;
the original transaction deadline is 180 seconds and at most six provider
contacts cover preparation, submission and readback. The sole success response
is HTTP200 with one exact JSON redirect. Create binds a positive issue index;
comment binds a positive comment ID on the original issue. Readback uses only
that exact numeric API path and compares actor, parent, IDs and full literal
fields. A comment's pull_request_url must be the empty string, and its parent
issue_url must be the original issue's exact web URL
(https://codeberg.org/{owner}/{repo}/issues/{index}), which is how pinned
15.0.9 serializes it.
Lost response remains Unknown with the original liability. Reload and execution
replay inspect history; they do not POST again or infer identity through listing
or search. An explicit separate bounded GET-only observation is possible only
when a trustworthy exact destination ID was retained. It leaves the original
Unknown unchanged. Missing identity remains unresolved even after positive
physical cleanup. Every outcome records no_learning; literal content remains
in current-owner protected storage and never becomes a generic model input.
Acceptance requires both complete UI/API/native-browser journeys against an
actual signed unmodified Forgejo 15.0.9 fixture, including exact approval,
one-POST/readback, private outcome, lost-response Unknown, restart inspection
and positive owned cleanup. Source inspection, profile registration and settings
tests alone do not establish that acceptance. backend/scripts/run_forgejo_form_fixture.py
runs those journeys against a disposable local Forgejo 15.0.9 (pinned binary
SHA-256, loopback only, offline mode) with sandboxed Chromium. Production Codeberg execution
remains separately blocked by its account/site/version acceptance boundary.
Validation and limitations
Provider-free isolated local Chromium acceptance must prove multi-field fill, select/check, literal preview, stale/ambiguous nodes, script/selector rejection, exact phase/body request denials, same-lane serial admission, cancellation and cleanup quarantine. Existing owner/API integration must prove durable read-only history after reload and private-input exclusion. External inference and sockets are denied; provider contacts and spend remain zero. A local fixture proves those paths, not production HTTPBin availability or business-form usefulness. No authenticated-session import or broad generic write permission is accepted.