feat(m3.5): AI analyze — deterministic form fill + safety + bounded execute - #32
Merged
Conversation
…xecute Adds `tron analyze` and wires the SDK page.analyze/step/runTask (PRD §11). Dry-run by default; --execute runs a bounded, safety-gated fill loop. tron analyze "Fill this contact form" --data ./lead.json tron analyze "..." --data ./lead.json --execute --no-submit tron analyze form --json packages/agent-runtime/src/analyze — deterministic, no LLM: - data/matching: flatten --data to dot-paths; match label/name/placeholder/ARIA to data with synonyms + confidence (values referenced by path, never echoed). - policy: risk classification — credential/payment/PII fields never auto-fill; submit needs --allow-submit; payment/irreversible submits blocked even then; CAPTCHA stops the loop. - form-script: in-page reader (refs from the snapshot's data-tron-ref, required, type, submit). forms/planner: build a form map + safe ordered plan; report missing required data and ambiguous mappings instead of guessing. - analyze: orchestration — dry-run returns the plan; execute fills low-risk fields then stops before the gated submit (bounded by --max-steps). - analyze-cli/-bin: `tron analyze` with --data (file/inline/stdin), --execute, --no-submit, --allow-submit, --policy, --json. Open-ended navigation goals return AI_PROVIDER_NOT_CONFIGURED (deterministic form path is complete; the BYOK/local planner is a follow-up). Wiring: install.sh routes `tron analyze` via a new generic bin launcher (tron-node.mjs) that resolves agent-runtime's @tronbrowser/* imports; build- release ships agent-runtime dist as analyze/; the SDK depends on agent-runtime and implements page.analyze/step/runTask; tron-run resolver maps agent-runtime. Tests (+38): matching/policy/data units, the in-page form reader (happy-dom), the analyze orchestration (dry-run map, missing data, CAPTCHA, high-risk field never filled, execute+no-submit, allow-submit, high-risk submit refused), and the CLI with fakes. Verified `tron analyze` end-to-end (dry-run + execute) via a WS CDP stub. Full workspace suite green in CI order. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
ralyodio
marked this pull request as ready for review
July 4, 2026 13:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements M3.5 — AI analyze (PRD §11) and wires the SDK
page.analyze/step/runTask. Basemain.Design: deterministic where it can be
Form-fill analyze needs no LLM — it's label/name/placeholder/ARIA → data-path matching with a safety policy. So that path is fully built and tested; only open-ended navigation needs a model (returns
AI_PROVIDER_NOT_CONFIGUREDrather than guessing — the BYOK/local planner is a follow-up).packages/agent-runtime/src/analyze--datato dot-paths; match fields with synonyms (e-mail→email, organization→company) + confidence. Plans referencelead.email, never the value (kept out of logs/traces).--allow-submit; payment/irreversible submits (Pay, Delete account, Transfer) are blocked even with--allow-submit; a CAPTCHA stops the loop.data-tron-ref,required, type, submit control).--executefills low-risk fields then stops before the gated submit, bounded by--max-steps.tron analyzewith--data(file/inline/stdin),--execute,--no-submit,--allow-submit,--policy,--json.Acceptance criteria (PRD §22)
--executefills low-risk fields; ✅ submit/risky require confirmation/policy.Wiring
install.shroutestron analyzevia a new generic bin launcher (tron-node.mjs) that resolves agent-runtime's@tronbrowser/*imports (agent-runtime dist isn't self-contained like browser-core's).build-release.shships agent-runtime dist asanalyze/; the SDK depends on agent-runtime and implementspage.analyze/step/runTask.Verification — +38 tests
tron analyzeend-to-end (dry-run → 0.98 field mapping + gated submit;--execute --no-submit→ 3 fills, stops before submit;--execute --allow-submit→ fills + submit → complete) via a WS CDP stub through the full dispatcher → runtime → CDP path.Scope
Deterministic form path is complete and tested. Open-ended LLM navigation is interface-only (needs a configured provider — untestable in CI). See
docs/analyze.md.🤖 Generated with Claude Code