Repository navigation
Two programs that share one contract, at the level where you stop thinking about
which one you are talking to. bwb is the agent. Drishti is the Android
browser it drives.
Meridian — the line where two ways of measuring the same place agree.
Drishti measures by sight, bwb measures by instruction, and the contract is the
line both measure from. Neither owns it.
Shipped as 4.5.0, re-cut as 4.5.1 the same hour. The banner
undercounted the tools (27 against the 41 the server returns) and the README
still quoted a 65 kB tarball that had not been true since 4.0. npm versions
are immutable, so the number moved instead of the bytes. One release, two
names: Meridian is 4.5.1.
npm i -g bwb-browser@4.5.1
bwb pair # prints a code, approve it on the phone
bwb drishti # every link in the chain, and how to fix the broken oneWhat actually got tied together
Contract v2, ratified in both repos. One document, one set of JSON fixtures,
byte-identical in bwb and drishti, asserted by both test suites and by a
drift check in CI that clones the sibling repo at a pinned commit. Neither repo
gets its own opinion about the wire format.
Tab leases. GET /bwb/tabs lists every tab with who holds it. Writing to a
shared tab means taking POST /bwb/tab/lease first: one exclusive writer,
120 s TTL, renewed by working. A refusal names the holder (held_by) so a client
backs off instead of retrying into the same wall. A lease is a deadline, not a
mutex — a killed agent frees its tab by expiring, nothing has to reap it. The
human holds no lease and no code path lets an agent lock him out of his browser.
X-BWB-Client. A stable identity, persisted next to the pairing token, so a
lease taken before a crash is still recognisably yours after it. Without it,
every restart would fight an expiring lease for two minutes because "someone
else" held the tab.
browser_newTab finally works on WebView. Found by reading, not by a test:
POST /bwb/tab answers with a registry id and never a CDP target id — WebView
exposes no mapping — so the old code built a tab entry pointing at nothing. The
client now lists targets before the create and takes the one that appeared
after. Two candidates means the human opened a tab in the same second, so the
URL decides; if it still cannot tell, it reports a failure rather than attaching
to somebody else's tab.
The bug worth the release
D5 — silence is not consent. waitForApproval returned approved: true
whenever the app reported no pending help. So a human who tapped Deny and a
human who tapped Allow produced the same result: the blocked step was retried.
A security decision was being inferred from an absence.
/bwb/state now carries last_help: the last resolved request, kept after the
app clears it. The client reads the decision — help while it is live,
last_help once it is gone — and treats no answer within the timeout as a
refusal. A failed attempt to raise the prompt is no longer "the app handled it,
carry on" either.
The doctor
✓ paired: token ••••a1b2 on port 9222
✓ relay: listening on 127.0.0.1:9222
✓ app: Drishti 1.0.0
✓ contract: v2 (tab leases, last_help) · 9 capabilities
✓ token: WebView (Android-Package: com.bwb.drishti)
✓ tabs: 3 page target(s)
✓ leases: 2/12 tabs, 1 leased (3f2a9c4e→bwb-a1b2c3)
✓ control: mode=AGENT · last decision: denied blocked.example
A v1 app is reported as pre-contract v2 — a sentence, not an investigation.
Known gaps, stated plainly
- Leases are advisory, not enforced.
bwbleases the tabs it creates and
every agent can see who holds what, but an ordinary CDP write does not lease
first: the app cannot map a CDP target id to a registry tab id, so there is
nothing to lease against before acting. Two agents on one tab are
discouraged, not blocked. Enforcement needs the relay to own the WebSocket
path, and it is the first item in 4.6.
The part that makes it a mega release
Everything an agent does used to be a CSS guess. Now the page reports its own
structure, and the rest of the surface exists so nothing has to sleep-and-hope.
The tree, with refs. browser_snapshot prints the accessibility tree as
indented text with [ref=e12] on everything a person can act on. Landmarks and
headings stay as structure — they describe the page, they are not targets.
aria-hidden subtrees never enter the tree; a text field's value never does
either. browser_click, browser_fill, browser_hover, browser_select,
browser_drag and browser_upload resolve a ref through
DOM.resolveNode(backendNodeId) — there is no selector to get wrong. A ref that
outlives its DOM throws StaleRefError and says re-snapshot: the failure mode is
not found, never clicked whatever moved into that slot. Refs are scoped per
tab, so two agents on two tabs cannot overwrite each other's snapshot.
The rest of the interaction surface. Hover is a real mouseMoved, so :hover
and menus open. browser_select fires input + change, so frameworks notice.
browser_press sends key, code and the virtual key code that agree, with
modifiers down first and up last, so Control+Shift+a arrives as one chord.
browser_scroll uses wheel events, so lazy loading behaves. browser_drag
releases the button in a finally, because a drag that throws must not turn
every later click into a drag.
Logs that are already recording. browser_console and browser_network
attach to every CDP client the moment it is handed out, so the errors thrown
during navigation are in the buffer before anyone thinks to ask. 300 console
entries and 400 requests, metadata only, never bodies. If instrumentation fails
the tool says why instead of returning a convincing empty list.
Page data. browser_extract returns links, tables (headers and rows, header
row excluded from the data), forms (types, labels, required, options) and
structured data (title, meta, JSON-LD, heading outline). browser_storage
returns localStorage, sessionStorage and cookie metadata only — a store of
values in context is a credential leak with extra steps. browser_frames lists
frames so browser_snapshot({frameId}) can read inside an iframe.
browser_dialog answers alert/confirm/prompt by policy, and is off by
default, because Drishti's own WebChromeClient answers dialogs and two answers
to one dialog is worse than one slow one.
41 tools. Up from 27.
Verified
207 checks green: 155 unit tests, 13 contract tests, 52 checks against a real
Chromium on this phone (snapshot 6, interaction 9, extraction 9, dialog 7,
integration 21), lint, smoke and doc verification. Drishti's CI builds the APK
and runs its JVM suite at a pinned bwb commit.
Not done, and named
- Nothing is device-tested through the Drishti app. No adb on this machine.
drishti/docs/VERIFY-4.5.md
is the two-minute run that settles it from the phone — including whether
WebView exposes an accessibility tree to a remote client, which is the only
app-side unknown in this release. - Leases are advisory, not enforced. They stop two agents disagreeing through
/bwb/tabs; they do not stop a CDP write to a tab you do not hold. That needs
the relay to own the WebSocket path — 4.6. - PDF export and request interception are not here.
Page.printToPDFis
desktop-only (WebView answers "not implemented"), and interception is a
routing engine with its own failure modes. 4.6, not smuggled into this one.