For AI agents: the complete documentation index is available at https://a3s-lab.github.io/Test/v1.0.1/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/Test/v1.0.1/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/Test/v1.0.1/en/concepts/architecture.md.

Architecture from first principles

The core problem is not making a model click a page. It is preserving a trustworthy chain from human intent to the exact interface state, the action that ran, the source that owns the result, and the evidence that proves the outcome.

A3S Test treats each link as a separate technical contract.

Constraints that shape the system

Fundamental constraintArchitectural consequence
A Web page is dynamic and an observation becomes staleBind every ref to an observation; retain only targets proven unaffected by an exact revision delta
The browser already owns DOM, accessibility, CSS, layout, and scrolling truthPage understanding is derived after rendering instead of reconstructed from a screenshot
Natural language does not define an executable safety boundaryActions use closed typed variants, schema validation, capability checks, and policy admission
A visible node and its source file are different identitiesTest Kit keeps explicit component ownership and ranked source spans as navigation evidence
Advice, permission, and mutation have different ownersBrowser facts, model candidates, human authorization, and workspace editing remain separate authorities
Exploration is useful but not reproducibleProven actions, waits, assertions, and evidence become a closed ACL suite
Cancellation can be more dangerous than a failed assertionEvery runtime, browser namespace, process tree, and artifact path has exact ownership

The complete evidence path

human intent / PRD / design
             |
             v
     reviewed expectation
             |
browser render + accessibility + Test Kit
             |
             v
   revision-bound observation
             |
     one typed action proposal
             |
       Core admission gate
 schema + capability + policy + origin
             |
             v
      Web / GUI / TUI driver
             |
             v
 events + assertions + owned artifacts
             |
 explicit human repair authorization
             |
             v
 source edit -> newer rendered revision
             |
             v
 fresh verification -> ACL regression

No arrow is implicit. An observation cannot authorize an edit. A model candidate cannot set a verdict. A source span cannot prove that the new page is correct. Verification must read the changed page again.

Four implementation layers

LayerImplementation
Post-render fact layerpackages/testkit and the Web adapter atomically combine browser semantics, Page Context, exact revision deltas, source mapping, and bounded UI evidence
Typed control layercrates/a3s-test-core and crates/a3s-test-session define actions, observation refs, policy, authority, session state, results, and driver contracts
Review and execution layerReview Overlay, crates/a3s-test-cli, and each Surface Driver submit explicit repair scope, dispatch admitted actions, and own runtime and cleanup boundaries
Verification and regressionSession verification, the ACL compiler, and the Runner retain changed-surface evidence, statically admit suites, and repeat bounded actions and assertions

CLI and MCP are entry points into these layers, not new authorities. Core never branches on a backend name. A deployment injects a typed SurfaceDriver; the adapter owns only the capabilities it can prove. Unsupported behavior fails closed.

Understanding happens after rendering

The browser has already solved layout. Test Kit reads a bounded projection of that result.

browser render
  ├── accessibility snapshot   role, name, native state
  ├── Page Context             component, locator, source, geometry, facts
  └── UI understanding         style, layout graph, clipping, state, motion
                                      |
                                      v
                           one admitted observation

Protocol a3s.test.page-context/1 is exposed through a non-enumerable, Symbol-addressed bridge. Private node identities live in a WeakMap, not in product DOM attributes. Mutation, resize, route, viewport, scroll, and form-state signals advance a monotonic revision. Snapshot detail, scope, time, node count, string size, and encoded bytes are bounded.

a3s.test.page-context-diff/1 hashes one bounded projection across revisions. It reports exact node, component, page, facts, and UI invalidation. Missing history or metadata that cannot fit the byte ceiling becomes reset_required, never an incomplete “no change.” The Web adapter validates that claim again in Rust. Core persists only a domain-separated SHA-256 fingerprint of private node identity before retaining an unaffected stable locator.

Public refs express authority instead of leaking private identity:

RefMeaning
@eNBrowser semantic target, actionable only in its observation
@cNUnique Page Context target; in its observation, only a proven unaffected locator may cross revision drift
@uNSupplemental style, layout, state, or motion evidence, permanently read-only

Rendered-node source mapping follows the same rule. A3STestBoundary may provide a coarse source hint. Framework adapters may explicitly register a DOM owner and an encoded Source Map v3. Test Kit ranks the resulting candidates but never reads framework private state, downloads a source map, or grants file authority.

Two planning entries, one execution core

calling coding agent                   closed ACL suite
 observe -> decide -> one action        admit -> execute -> assert
               \                       /
                    typed A3S Test Core
             Action · Policy · Evidence · Lifecycle

A persistent agent session is useful while the path is unknown. The calling coding agent chooses one action from each fresh observation. ACL is useful after the path is understood. It closes the allowed actions, waits, assertions, and evidence before execution. Both routes use the same driver and result contracts, so exploration does not need a second automation model to become regression coverage.

Four independent authorities

  1. Rendered facts come from surface observations, Test Kit context, deterministic assertions, file digests, and owned evidence.
  2. Model advice may propose visual locations, design findings, or contract candidates with provenance, confidence, and budgets.
  3. Human authorization chooses the target, expected result, conflicts, and single or batch repair scope.
  4. Workspace execution belongs to the coding agent that already owns the workspace; A3S Test verifies its result in a newer browser revision.

Projecting a report into the Review Overlay never changes a runner verdict. Opening an editor or saving a draft never enters the repair ledger. Only explicit submission crosses that boundary.

Runtime and evidence ownership

Every launched program belongs to an A3S Test process group, Windows Job, or equivalent owned tree. Cancellation and timeout kill and reap the complete tree through bounded graceful and emergency paths. An existing developer server or unrelated browser session remains untouched.

Web sessions use an isolated namespace and non-zero idle timeout. Artifact paths must resolve to fresh regular files inside the session root. Traversal, symlinks, reparse points, stale output, oversized evidence, and unsupported payloads fail before they can impersonate a successful capture.

Surface and provider boundaries

SurfaceCurrent implementation boundary
WebA3S Browser or a compatible standalone browser, with persistent sessions, ACL, semantic refs, Page Context, evidence, and isolated network policy
GUILocked macOS A3S CUA integration with permission, perception, and exact-cleanup verification on a real arm64 host
TUINative PTY / ConPTY, bounded VT semantics, and an owned command process tree, currently driven through ACL

Optional LLM, grounding, and design providers are typed injected objects. HTTP adapters disable redirects and environment proxies, require HTTPS except for explicit loopback HTTP, bound bodies and deadlines, and redact authorization values. Provider output remains advice until the surrounding deterministic and human boundaries admit it.

Continue with Page Context fields and lifecycle for the browser-side protocol, or Authority and safety for admission and failure behavior.