* fix(interaction): refuse fill, type, check, uncheck and select on preconditions fill, type, check, uncheck and select reported success without checking the target. The target's own properties now decide, before anything changes: - Refuse with stable codes: not_editable, read_only, disabled, not_checkable, option_not_found, ambiguous, malformed_value. - fill sets date, time, color and range inputs directly and rejects values the input would sanitize away. - check and uncheck return when the state already matches, refuse non-toggle elements, a checked radio and disabled controls, and retry with a DOM click for native inputs only. - select takes a unique exact label, then a unique exact value, otherwise ambiguous; options sharing a value are one choice; several values on a non-multiple select are refused first; multiselect shares the checks. - Whether the page ended up as requested is a warning shown in text and JSON output, not an error. - type with only newline, carriage return and tab keeps the key dispatch. Text insertion and clearing are unchanged. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): narrow refusals to never-text elements, tolerate failed reads, select --by - fill and type refuse only elements that can never take text (select, button, checkbox, radio, file, submit and reset inputs, and color, range and date-type inputs for type); where text lands for everything else is unchanged. A label stands for its control. - A failed read after the action (context destroyed, page navigated) is a warning, not an error, and a probe that cannot inspect the element lets the action proceed. - select: a string that matches exactly one option by value or exact label selects it; matching options with different values, across kinds or by shared label, is ambiguous. --by value|label (and a by field in MCP) restricts matching so every option is reachable. Several values on a single select are not_multiple. - Option and treeitem state comes from aria-selected, role tokens are parsed, line endings are normalized before comparing, and the form warning is carried in its own data key. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): snap range values to the step, point type at fill - fill on a range input inside its bounds sets the value the browser snaps to and warns with the requested and held values; unparsable and out-of-range values stay malformed_value. - The refusal hint for type on color, range and date-type inputs says to use fill to set the value of the input. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): select takes dash-leading values, buttons behave as before - select treats only --by <v>, --by=<v> and a leading -- as special; values such as "-- Select --" or "-none-" are data, as in the type parser. A repeated --by is rejected. - fill and type no longer refuse button, submit, reset and button inputs: whether text reaches a field through them depends on focus. - A read that fails because the page navigated reports "page navigated after the action; result not verified". - The ambiguous error advises the by field over MCP and the --by flag in the listbox path; the select synopsis in the docs lists --by. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): type no longer refuses readonly inputs type does not clear the field, so a readonly input is left to the page as before (a trigger may forward focus to another field); fill still refuses it because it would empty the value. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): form warnings never echo field values; option labels are the browser's labels - A fill whose value the page rewrote reports the change by length (length 10 -> 14) or as a different value of the same length; the snapped-range warning, the malformed_value error and the could-not-verify warning no longer repeat a value or a raw error. - An option's label is option.label, the text the browser shows. select matches it by default and with --by label, and no longer matches the hidden text of an option that has a label override, which removes false ambiguity. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): type --clear is refused on readonly fields Any step that destroys a field's value is refused on a readonly field, not only fill: type --clear empties the value before the browser drops the text. A plain type does not clear, so it keeps its behavior. The type help, docs, MCP description and skill text say so. Co-Authored-By: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com> * fix(interaction): fill and type act on one resolved control, refuse non-text targets and report altered text Labels and date parts resolve to their control once, and focus, clear, insert and read-back all use it. Options and hidden, image, button, submit and reset inputs are refused with the other targets that never take text, from one table. type compares the read-back with the prior value plus the typed text and warns on a maxlength cut or a mask rewrite. Errors and warnings name the target from the caller's selector and a fixed tag and input-type vocabulary; ids, tag names and option labels from the page are never included. * docs: describe refused targets and ambiguous select results * fix(interaction): scrub page strings from select errors, refuse buttons and controlless labels, warn only when typed text is missing * fix(interaction): page text never reaches form errors, refuse targets that take no focus, report maxlength cuts and replace editable content The precheck, select and value-input failures return a kind or a number and the message is built in Rust, so nothing a page returns is repeated in an error. fill and type refuse a target that neither takes focus nor forwards it to another field, walking open and closed shadow roots. type warns when the old value plus the typed text exceeds maxlength and the field is full, even when the old value already contains the typed text. fill replaces the content of an editable region instead of appending. * fix(interaction): refuse by focusability, not by focus movement; keys-only text skips the focus guard A focusable target whose focus handler forwards to the already-focused field is a valid typing path. The guard now refuses only a target that cannot take focus and where focus did not land. Key-only text goes to the focused control as before. * fix(daemon): box fill/type futures and isolate the har_stop test env The fill and type futures grew the execute_command frame past a debug test thread's stack. The har_stop test built its state without the env lock, so an action policy path set by another test leaked into it. * fix(interaction): guard on an observed focus signal instead of tabIndex A hidden, display:none or inert input has tabIndex 0 but cannot take focus. The guard now allows a target that received focus or a focus event during focus() and refuses otherwise. * fix(interaction): count only trusted focus events in the focus guard A page could override focus() to dispatch a synthetic focus event and pass the guard, sending text to the field that already had focus. * fix(interaction): clear editable regions in their own document, return select options as error data, measure maxlength after focus selection - fill and type --clear select and delete an editable region through its ownerDocument, so a region inside a same-origin iframe is replaced instead of prepended to. - select no-match errors keep fixed text with the option count; the options go to data.options as [{value, label}], printed inside content boundaries by the CLI. - the maxlength check subtracts the text selected after focus, so a field that selects on focus does not report a cut that did not happen. * fix(form): treat input and textarea as text controls inside a contenteditable ancestor isContentEditable is inherited by form controls, so fill deleted a textarea and the read-back used innerText. One helper classifies by tag first; only a non-control element with isContentEditable is an editor. * fix(mcp): pass select's by mode after the selector The select parser reads its first argument as the selector, so --by placed before it became the selector. MCP now builds select -- <selector> [--by <mode>] -- <values>. * fix(select): refuse an empty value list and keep option data out of the MCP advice rewrite An empty list matched nothing but cleared the selection. The by-field rewrite now touches only the error message, so option labels in the response data stay as the page wrote them. * fix(interaction): refuse clearing a field that turns readonly on focus The readonly check ran before focus, so a field whose focus handler sets readOnly passed it, and the clear step then emptied the value. fill and type --clear now check again at the clear step and refuse with read_only, keeping the value. * fix: accept every css color chrome accepts when filling a color input * fix: update the mcp tool catalog for color fill * fix(interaction): check stored color, controls in editors, and normalized range values A color input that stores a color other than the one requested, such as black for red on a browser that accepts only #rrggbb, now fails with malformed_value and keeps its previous value. A select, option, or button inside an editable region is refused like it is anywhere else instead of being replaced by the text, unless it is itself an editing host. Range and other value inputs are compared with the value the browser stored, so 50.0 stored as 50 no longer warns. --------- Co-authored-by: FredAmartey <43480311+FredAmartey@users.noreply.github.com> Co-authored-by: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-authored-by: HoneyTyagii <78690656+HoneyTyagii@users.noreply.github.com>
Agent-browser Geistdocs regression suite
Fixture provenance
fixtures/docs-baseline.json is pinned to efee3893d9080fcacb1aa6c9a21d13fbc6021f20. The capture script reads git objects at that commit, not migrated application code or content. It preserves all 39 original docs/src/app/**/page.mdx files, their layouts, root metadata, mdx-components.tsx, page-metadata.ts, page-titles.ts, navigation, search implementation, and mdx-to-markdown.ts: 86 complete source files with SHA-256 hashes. Public resources and favicon are pinned by byte length and SHA-256.
Each page records its complete source hash, original H1 insertion position, metadata, heading levels/text/IDs, prose paragraphs, table cells, code examples, links, legacy Markdown and new Markdown derived from the original source. The H1 insertion position preserves imports before the title, as on /diffing.
The generator executes the original slugger and recursive React-child text extractor without substituting GitHub slugging or deduplicating IDs. The independent oracle compiles and renders the captured original MDX with the original heading components, checking every captured heading and content sample. Synthetic cases exercise nested inline children, numeric text, punctuation and duplicate IDs. Fenced code is not parsed as headings.
Never regenerate fixtures from migrated output to accept a failing assertion. To verify reproducibility from the pinned commit:
node scripts/capture-docs-baseline.mjs --check
To reproduce the same frozen baseline explicitly:
node scripts/capture-docs-baseline.mjs
node scripts/capture-docs-baseline.mjs --check
Running tests
Run from docs/:
node --test tests/docs-baseline.test.mjs tests/baseline-oracle.test.mjs
node scripts/test-routes.mjs
The route runner requires a completed production build. It starts an isolated next start process on an ephemeral loopback port, waits for readiness, runs the Node tests, propagates failures, and cleans up its child processes. It does not build or start a development server. Its lifecycle follows the portless and json-render reference suites.
Production and preview checks need matching build environments, including statically generated metadata and robots:
VERCEL_ENV=production pnpm run build
node scripts/test-routes.mjs
VERCEL_ENV=preview pnpm run build
node scripts/test-routes.mjs --preview
The runner explicitly sets VERCEL_ENV and DOCS_EXPECT_NOINDEX. Preview requires noindex in HTML metadata and response headers and Disallow: / in robots. Reusing a production build can expose metadata baked into the wrong environment.
To test an already running production server without starting or stopping any server:
DOCS_TEST_URL=http://127.0.0.1:3000 DOCS_EXPECT_NOINDEX=0 node --test tests/docs-routes.test.mjs
Set DOCS_EXPECT_NOINDEX=1 when testing an existing preview server. The capture script and original-render oracle use typescript, @mdx-js/mdx, react, and react-dom; the HTTP suite uses Node built-ins.
Regression invariants
Byte-for-byte MDX reconstruction, full Markdown equality, heading multiplicity and legacy search ranking were migration checks against the pinned commit. They were removed after the migration merged because any later content edit fails them. Remaining checks treat the baseline as a floor: every original line must still render in order, and new lines are allowed anywhere, including inside tables and code blocks. When a change intentionally rewrites original text, add a from/to entry for that page to fixtures/docs-edits.json, or the new size and SHA-256 for a changed public resource. Each from must still occur in the baseline, so stale entries fail. Never edit docs-baseline.json itself.
- SSR prose/table/code content from the baseline, plus metadata, canonical URLs and Markdown alternates for every public page.
- Every baseline page's Markdown API,
.md, negotiated Markdown and legacy query API bodies. Every public page's HEAD responses for all five representations. - Pages added after the baseline (
addedPagesintests/helpers.mjs) have no baseline fixture to compare against, so the shared loops give them only the path checks: the metadata group, HEAD representations, locale alias, trailing-slash redirect and OG endpoint. The content parity, Markdown parity, legacy Markdown parity and search breadcrumb checks stay with the baseline pages. A page-specific test may still cover added content, such as the Modern Web Guidance test asserting its three Markdown representations agree and keep every section heading. - Link destinations are resolved against the canonical page URL before comparison. Absolute and relative references to the same resource are equivalent; changes to origin, path, query or fragment are not.
- Images retain original alt text. Direct sources and every responsive
srcsetcandidate are resolved through Next's image optimizer to their underlying same-origin resources. Those bytes must match the original resource fixture's length and SHA-256, including when static imports generate hashed filenames. Alt text or filenames alone cannot establish image parity. - Accept quality/exclusion, browsers, AI bots, preview/search bots, unmodified Sec-Fetch headers, RSC, both Next prefetch headers, Purpose and Sec-Purpose.
- RSC requests use the valid empty cachebuster
/commands?_rsc. A separate test checks Next's 307 normalization of an invalid cachebuster, then verifies Flight at the destination. Redirects are not accepted as successful Flight responses. - Explicit Vary tokens for Accept, User-Agent, Signature-Agent, Sec-Fetch-Mode, Sec-Fetch-Dest, RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Next-Url, Purpose and Sec-Purpose; private/no-store and both CDN no-store headers; no locale cookies.
- Alternating HTML/Markdown requests cannot contaminate one another. Tracking queries must not change visible text, metadata, document links or Markdown. Next's Flight hydration scripts may serialize the request URL; their presence is not content or canonical leakage. Mutation tests demonstrate that visible, canonical and OG leakage still fails.
- Permanent locale and trailing-slash redirects preserve request origin and queries. HTML/Markdown/API misses return real 404s, including HEAD. Raw malformed encoding, encoded separators/control characters, double encoding and unsafe legacy path values are rejected.
- Legacy search object shape and empty-query behavior; native search arrays containing table text and nested-section fragments that resolve to SSR anchors.
- Exact canonical sitemap/index inventories, environment-aware robots, original static resource hashes, every public page's OG PNG endpoint with signature and 1200x630 dimensions, and Next CSS/JS/font routing.
Compatibility contracts
- Legacy
/api/search?q=...returns{ "results": [...] }. Entries havetitle,href,sectionandsnippet, with at most 20 ranked results. Absent, empty and whitespace-only legacy queries return{ "results": [] }. Native?query=...&locale=enreturns Fumadocs result arrays. - Legacy
/api/docs-markdown?path=...returns bare, trimmed output from the original converter, without YAML frontmatter or a trailing newline. It acceptscommands,/commandsand trailing slashes. The first repeatedpathparameter wins. Missing/empty parameters return JSON 400 withMissing ?path= parameter; unknown paths return JSON 404 withPage not found. - The original converter removes lines beginning with
exportorimporteven inside code fences and retains<DiffDemo />. Legacy fixtures preserve those historical bytes. New Markdown is a separate, lossless contract: original MDX with only AST-level imports, the non-textual DiffDemo component and presentationclassNameattributes removed. Fenced imports/exports remain intact. These endpoints must not be made artificially equal by changing fixtures. - The original slugger is stateless.
/diffinghas three#optionsand two#outputheadings;/changeloghas 53#bug-fixesheadings;/streaminghas two#streamingtargets across its H1 and H2. Nested headings must not silently acquire numeric suffixes. An H1 may use a separate addressable alias when Geistdocs renders the title, but original ID multiplicity remains required. - The homepage H1 is
agent-browser; its document/OG/Twitter title isagent-browser | Browser Automation for AI. The rootPAGE_TITLESentry is for OG rendering, not the document title. - Unsafe legacy traversal must return JSON 400 or 404 rather than reproducing the old sanitizer's ability to turn traversal into unrelated valid pages. Successful content is never accepted for these inputs.