This document compares three implementation plans for turning Grain transcripts into X-Pilot doc-to-video outputs using an agent that attaches to a user-started Chrome session.
The goal is not just to list options. The goal is to:
- propose 3 realistic plans,
- test them against the current official documentation,
- use role-based reviewer agents to challenge the plans,
- reach consensus on the most accurate and most business-safe plan,
- agree on the ordered steps of the final plan.
- The default mode must allow the agent to complete the full process end to end.
- A
dry_runmode with a human approval gate must exist, but it is optional. - The agent must attach to a user-started Chrome session for X-Pilot sign-in and upload flows.
- The plan must not rely on a public X-Pilot API unless the account actually has confirmed access.
- The plan must work with Grain transcripts first, because that is the source material.
These are the facts the plans must respect.
- Grain v2 exposes List Recordings, Get Recording, Get Recording Transcript (json), and Get Recording Transcript in
.txt,.vtt, and.srtformats. - Transcript JSON returns
speaker,start,end, andtext, which is the right shape for sectioning, source traceability, and clip mapping. - Grain also exposes hooks and documents
recording_added,recording_updated, andupload_statusamong the hook types.
- Chrome DevTools MCP supports browser control tools including
click,fill,upload_file,new_page,select_page,wait_for,evaluate_script,take_snapshot, andtake_screenshot. - Chrome DevTools MCP can attach to an already running browser using
--browserUrlor--wsEndpoint. - Chrome DevTools MCP also supports
--autoConnect, but only for supported Chrome versions and with user-enabled remote debugging. - Chrome 136 changed remote debugging behavior: debugging switches are not respected for the default Chrome data directory. A non-default
--user-data-diris required. - Playwright supports
connectOverCDP(...)for attaching to an existing Chromium browser, but Playwright warns that CDP attachment is lower fidelity than native Playwright protocol. - Puppeteer supports reconnecting to an existing browser through
Puppeteer.connect(...)and a WebSocket endpoint. - Chrome extensions can use
chrome.debuggeras an alternate transport for the Chrome DevTools Protocol, but that API has restricted domains.
- X-Pilot accepts
.pdf,.ppt/.pptx,.doc/.docx,.md/.markdown, and.txtinputs. - X-Pilot says headings improve results and H1/H2/H3 structure becomes video chapters automatically.
- X-Pilot documents a 50,000 character maximum per video on the text-to-video workflow.
- X-Pilot says Pro and above can batch process up to 50 documents simultaneously.
- X-Pilot exports MP4 and SCORM, and its FAQ also references xAPI on Enterprise.
- Public X-Pilot materials are inconsistent about API access. One FAQ pricing table says Pro includes API, while the technical FAQ says API and custom integrations are Enterprise-only. Because of that inconsistency, the safest implementation assumption is: do not depend on X-Pilot API access for the production MVP.
- Browserbase contexts persist cookies and auth state across sessions.
- Browserbase
keepAlivelets a session survive disconnects and reconnect later. - Browserbase also explicitly notes that websites can still expire sessions, revoke tokens, or force logouts.
I could not introspect the exact live Grain MCP method names from this ChatGPT environment.
Because of that, this plan uses a canonical Grain adapter interface. During implementation, the first task is to map the real Grain MCP method names in your host to that interface.
That is a setup task, not a product risk.
Build the smallest possible production system:
Grain MCP -> normalize -> batch folder -> Chrome DevTools MCP -> X-Pilot
Use only one browser driver, one execution path, and one recovery mode.
This is the fastest way to get from idea to usable output. It minimizes engineering overhead and validates business value quickly.
Grain MCP
-> transcript fetch
-> normalize + chunk
-> docs/*.md + manifest.json
-> attach to user-started Chrome via Chrome DevTools MCP
-> upload to X-Pilot
-> parse/review
-> export MP4/SCORM
-> save outputs
list_recordings()
get_recording(recording_id)
get_recording_transcript_json(recording_id)
get_recording_transcript_txt(recording_id)
create_hook?(hook_url, hook_type)
list_hooks?()
delete_hook?(hook_id)new_page()
navigate_page()
select_page()
list_pages()
wait_for()
click()
fill()
press_key()
upload_file()
evaluate_script()
take_snapshot()
take_screenshot()Default.
The agent:
- fetches transcripts,
- normalizes them,
- writes docs,
- attaches to Chrome,
- uploads docs,
- waits for parse,
- exports outputs,
- downloads artifacts,
- marks the batch complete.
Optional.
The agent:
- fetches transcripts,
- normalizes them,
- writes docs and a review packet,
- stops before upload,
- waits for human approval.
- Fastest to build.
- Most direct path to value.
- Uses only current, documented public capabilities.
- Avoids relying on uncertain X-Pilot API access.
- Single browser driver dependency.
- If Chrome DevTools MCP attach fails, the whole run stalls.
- Weakest resilience against auth disruptions.
- Least suitable for business-critical uptime.
Accurate but incomplete.
This plan matches the public documentation, but it underestimates the need for attach fallbacks and auth recovery if the workflow becomes business-critical.
Keep the local-user-started-Chrome requirement, but introduce an explicit Attach Manager so the agent can keep working if one attach client fails.
Grain MCP -> normalize -> batch folder -> Attach Manager -> X-Pilot
This is the best balance of speed, accuracy, and resilience.
It still treats the user-started dedicated Chrome session as the source of truth for authentication, but it avoids depending on a single browser automation client.
Grain MCP
-> transcript fetch
-> normalize + chunk
-> docs/*.md + manifest.json
-> Attach Manager
1. Chrome DevTools MCP via --browserUrl / --wsEndpoint
2. Chrome DevTools MCP via --autoConnect
3. Playwright connectOverCDP(...)
4. Puppeteer.connect(...)
5. Optional companion extension via chrome.debugger
-> X-Pilot upload / parse / export
-> outputs + state store
The user should start a dedicated local Chrome automation profile for X-Pilot, not their everyday browsing profile.
That profile should:
- use a non-default user-data-dir,
- keep a stable signed-in X-Pilot session,
- expose a remote debugging endpoint,
- be the only Chrome instance the agent is allowed to control.
This is the most accurate interpretation of the current Chrome security model and the safest way to preserve sign-in continuity.
Treat browser control as a pluggable transport layer, not as the product itself.
If DevTools MCP is down, the agent should not lose the run. It should reattach through another client to the same already running Chrome session.
DISCOVERED
-> FETCHED
-> NORMALIZED
-> BATCH_READY
-> AWAITING_APPROVAL [only if dry_run or forced review]
-> ATTACHING
-> ATTACHED
-> AUTHENTICATED
-> UPLOADING
-> PARSED
-> EXPORTING
-> DOWNLOADING
-> COMPLETE
NEW
-> TRANSCRIPT_READY
-> DOC_READY
-> READY_FOR_UPLOAD
-> UPLOADED
-> PARSED
-> EXPORTED
-> DOWNLOADED
-> FAILED
runs/
2026-04-17/
run_001/
manifest.json
review.md
docs/
lesson-001.md
lesson-002.md
source/
lesson-001.transcript.json
lesson-001.transcript.txt
exports/
logs/
orchestrator.jsonl
browser.jsonl
{
"run_id": "run_001",
"mode": "auto",
"status": "BATCH_READY",
"browser_profile": "xpilot-automation",
"attach_path": null,
"items": []
}For each Grain transcript:
- ingest transcript JSON as the system of record,
- use TXT only as audit-friendly fallback,
- group transcript blocks into topic sections,
- add explicit H1/H2/H3 structure,
- keep each output document under 42,000 characters as a safety margin below X-Pilot's 50,000-character limit,
- preserve source traceability through timecode comments.
# Lesson Title
## Objective
One clear learner outcome.
## Context
Short framing section.
## Core Idea 1
Explanation.
## Example
Concrete example.
## Common Mistake
Likely learner error.
## Core Idea 2
Explanation.
## Recap
- Bullet 1
- Bullet 2
- Bullet 3
<!-- grain_recording_id: ... -->
<!-- start_ms: ... -->
<!-- end_ms: ... -->The agent should attempt attach in this order:
- Chrome DevTools MCP with
--browserUrlor--wsEndpoint - Chrome DevTools MCP with
--autoConnect - Playwright
connectOverCDP(...) - Puppeteer
connect(...) - Optional companion extension using
chrome.debugger
If all five fail, the run enters AUTH_OR_ATTACH_RECOVERY_REQUIRED.
The system should never assume the session is valid just because the browser attached.
It must check an auth sentinel on X-Pilot, for example:
- dashboard shell exists,
- upload CTA exists,
- no login form is visible,
- no redirect to auth routes,
- current user marker is present.
If any check fails:
- mark run as
AUTH_REQUIRED, - pause,
- request user takeover,
- resume the same run after sign-in.
- Strongest balance of accuracy and implementation realism.
- Keeps the user-started Chrome requirement intact.
- Avoids overcommitting to unverified X-Pilot API access.
- Allows recovery from attach client failures without discarding the run.
- Business-safe enough to use as the production baseline.
- More engineering work than Version 1.
- Requires clear attach instrumentation and logs.
- Needs a dedicated Chrome profile policy.
Most accurate and most defensible.
This plan aligns with the documentation and avoids making unverified promises.
Build Version 2, but also add a separate cloud recovery lane so the process can continue even if the local machine disconnects.
This plan maximizes continuity for a high-value business workflow.
Primary lane:
Grain MCP
-> normalize
-> batch folder
-> user-started local Chrome
-> X-Pilot
Recovery lane:
Browserbase context + keepAlive
-> reconnectable cloud session
-> same X-Pilot workflow
If the local run fails because of:
- laptop sleep,
- local network loss,
- local browser crash,
- MCP transport failure,
then the orchestrator may continue from a recovery lane.
- Best continuity.
- Good for overnight jobs.
- Good for reconnect workflows.
- Violates the spirit of "always attach to the user-started Chrome session" once the recovery lane takes over.
- Adds cost, infra, and another security surface.
- Browserbase itself warns that sites can still expire cookies, revoke tokens, or force logout.
- Too much complexity for the first production version.
Accurate as an optional add-on, not as the default plan.
This plan is useful, but only after the local attach plan is working.
These are role-based reviewer agents, not external tools. Each reviewer evaluated the three plans against the documented constraints and business needs.
- attach reliability
- auth continuity
- browser-client fallback depth
- resumability
- Version 1 is too thin for revenue-critical execution.
- Version 2 is the strongest because it keeps a single auth truth source while allowing multiple attach clients.
- Version 3 is valuable later, but it complicates the sign-in story and adds infrastructure too early.
- Version 2
- Version 1
- Version 3
- Chrome 136+ remote debugging safety
- separation from the default browsing profile
- recoverability
- avoiding undocumented vendor dependencies
- Version 1 is accurate, but fragile.
- Version 2 is the best because it uses a dedicated non-default profile and does not depend on unverified X-Pilot API access.
- Version 3 has legitimate recovery value, but it should not be the default because it changes the trust boundary.
- Version 2
- Version 3
- Version 1
- fastest path to useful output
- lowest operational surprise
- ease of support
- clear human checkpoint when auth breaks
- Version 1 is tempting because it is simple.
- Version 2 is the best business choice because it stays simple enough while solving the failure modes that would hurt a real business.
- Version 3 is too much for the first commit.
- Version 2
- Version 1
- Version 3
All three reviewer agents agree that the best plan is Version 2, with:
- the simplicity of Version 1 for the MVP milestone,
- the attach fallback ladder of Version 2 as the production baseline,
- and the cloud recovery ideas from Version 3 kept as a later enhancement, not day-one scope.
The most accurate plan is the one that:
- assumes Grain transcript ingest is stable,
- assumes X-Pilot browser automation is the primary path,
- assumes X-Pilot API access is not reliable enough to plan against,
- uses a dedicated user-started Chrome profile with non-default user-data-dir,
- treats browser attachment as replaceable transport, not as the whole system,
- accepts that human re-authentication remains a real recovery case.
That is Version 2.
These are the steps all reviewer agents agreed on.
- Create a dedicated X-Pilot automation Chrome profile.
- Launch it with a non-default user-data-dir and remote debugging enabled.
- Sign in to X-Pilot manually once in that profile.
- Store no passwords or 2FA codes in chat or logs.
- Map the real Grain MCP tool names to the canonical Grain adapter surface.
- Verify the required transcript methods exist.
- Verify at least one hook path exists for event-driven triggering, or fall back to scheduled polling.
- List target recordings from Grain.
- Fetch transcript JSON and TXT.
- Normalize transcripts into structured Markdown with H1/H2/H3 headings.
- Chunk long documents below the X-Pilot character budget.
- Write
docs/,source/,manifest.json, andreview.mdinto a batch folder.
- If
mode = dry_run, stop here and require approval. - If
mode = auto, continue automatically unless a forced-review rule triggers.
- Attach to the running Chrome via the Attach Manager.
- Run the X-Pilot auth sentinel.
- If auth is broken, request user takeover and resume the same run.
- Upload documents to X-Pilot.
- Wait for parse completion.
- Validate title, structure, and scene generation.
- Export MP4 and SCORM where required.
- Download artifacts into
exports/.
- Mark item states complete.
- Write a run report with successes, failures, and retry reasons.
- Keep enough logs to resume without starting over.
Even in auto, the run must stop for review if:
- transcript quality is poor,
- PII or regulated content is detected,
- topic boundaries are low confidence,
- the attach ladder exhausts all local options,
- X-Pilot parse results are malformed,
- auth requires reentry,
- export fails repeatedly.
Build Version 2 first.
That means:
- local dedicated Chrome profile,
- explicit attach manager,
- Grain transcript normalization,
- batch-folder execution,
- X-Pilot browser automation,
- optional
dry_run, - human reauth lane,
- no API dependency for MVP.
Do not start with Version 3. Do not ship Version 1 as the long-term architecture.
runs/
<date>/
<run_id>/
manifest.json
review.md
docs/
source/
exports/
logs/
mode: auto
require_human_approval: false
forced_review_on_auth_failure: true
browser_profile: xpilot-automation
attach_order:
- chrome_devtools_mcp_browser_url
- chrome_devtools_mcp_auto_connect
- playwright_cdp
- puppeteer_connect
- chrome_debugger_extension
char_budget_per_doc: 42000
batch_size: 25X-Pilot says up to 50 docs simultaneously, but 25 is the safer operational default for the first production version. It gives better failure isolation and easier reruns.
Official sources used for the review:
- Grain API: https://developers.grain.com/
- Chrome DevTools MCP blog: https://developer.chrome.com/blog/chrome-devtools-mcp
- Chrome DevTools MCP existing-session blog: https://developer.chrome.com/blog/chrome-devtools-mcp-debug-your-browser-session
- Chrome remote debugging change: https://developer.chrome.com/blog/remote-debugging-port
- Chrome DevTools MCP GitHub: https://github.com/mcp/ChromeDevTools/chrome-devtools-mcp
- Playwright BrowserType docs: https://playwright.dev/docs/api/class-browsertype
- Puppeteer connect docs: https://pptr.dev/api/puppeteer.puppeteer.connect
- Puppeteer wsEndpoint docs: https://pptr.dev/api/puppeteer.browser.wsendpoint
- Chrome debugger API: https://developer.chrome.com/docs/extensions/reference/api/debugger
- Browserbase Contexts: https://docs.browserbase.com/features/contexts
- Browserbase Keep Alive: https://docs.browserbase.com/features/keep-alive
- X-Pilot FAQ: https://www.x-pilot.ai/resources/faq
- X-Pilot Text-to-Video: https://www.x-pilot.ai/products/text-to-video