You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenChrome currently records useful long-run facts in several places:
task journal JSONL records every tool call,
recording stores action timelines and screenshots,
checkpoint stores task progress and tab state,
Outcome Contracts produce assertion evidence,
hints/progress logic detects stalls and recovery suggestions.
Those artifacts are valuable but fragmented. A long-running task failure should produce one portable episode trajectory bundle that lets a maintainer answer:
What did the agent try?
What browser state changed after each step?
Where did progress stop?
Which contract failed?
Which checkpoint can be used to resume or reproduce?
CUA's transferable idea is its event/image trajectory format. OpenChrome should adopt a deterministic, file-based bundle that unifies existing artifacts without changing tool behavior.
Directionality / fit check
This issue is observability-only:
It records facts; it does not make LLM decisions.
It does not introduce server-side agent loops.
It does not require external services or credentials.
It must degrade to no-op if storage is unavailable.
Existing tools and recording behavior remain compatible.
Proposed implementation
Add an optional trajectory bundle writer under src/trajectory/ and expose it through the existing recording/journal/checkpoint paths.
Primary deliverable: a trajectory bundle that unifies existing journal, recording, checkpoint, contract, hint, and artifact references into one portable evidence directory/report.
Non-goal: changing action semantics, adding a new autonomous runner, requiring external storage, or turning every session into a heavy recording by default.
If bundle activation depends on recording options, preserve existing recording behavior for users who do not opt in.
Implementation checklist
Define the trajectory bundle directory schema, including manifest, events/journal references, recording timeline, checkpoints, contract results, hint/progress snapshots, screenshots/artifacts, and redaction metadata.
Add an explicit opt-in activation path, such as a recording/session option, so default runtime overhead remains low.
Reuse existing journal/recording/checkpoint data instead of duplicating full payloads unless a stable reference is not enough.
Apply existing secret/redaction policy consistently to manifest, JSONL, reports, and copied artifacts.
Make screenshots/artifact copying best-effort and clearly mark missing artifacts rather than failing the whole bundle.
Add tests for enabled bundle export, disabled/default behavior, redaction, missing artifact handling, and manifest stability.
Success criteria
A completed opt-in run produces a deterministic bundle with enough references to reconstruct what happened without reading scattered internal files manually.
Bundle generation does not alter browser behavior or action ordering.
Disabled/default runs avoid material overhead and do not produce unexpected bundle directories.
The bundle is safe to attach to issues/PRs after redaction checks.
Post-merge OpenChrome live verification checklist
Run OpenChrome against a local fixture with trajectory bundle recording enabled; verify a bundle directory with manifest/report/events references is created.
Run the same fixture with bundle recording disabled; verify no unexpected heavy bundle is produced.
Inspect the bundle for redacted secrets and stable relative artifact paths.
Attach the manifest/report path and a concise artifact listing to merge verification notes.
Tier: core observability, additive only
PR target:
developSource analysis: CUA-style replayable trajectories, adapted to OpenChrome's existing journal / recording / checkpoint / contract evidence.
Why
OpenChrome currently records useful long-run facts in several places:
Those artifacts are valuable but fragmented. A long-running task failure should produce one portable episode trajectory bundle that lets a maintainer answer:
CUA's transferable idea is its event/image trajectory format. OpenChrome should adopt a deterministic, file-based bundle that unifies existing artifacts without changing tool behavior.
Directionality / fit check
This issue is observability-only:
Proposed implementation
Add an optional trajectory bundle writer under
src/trajectory/and expose it through the existing recording/journal/checkpoint paths.Bundle layout
Default root:
trajectory_idformat:traj-YYYYMMDD-HHMMSS-<6hex>.Event schema
Each event is one JSONL row:
Bounds:
argsSummaryandresultSummary≤ 4 KiB each after redaction.Start/stop behavior
Use the existing
recordingtool as the activation point. The PR must not add a separate trajectory lifecycle tool.recording startaccepts optional{ "trajectoryBundle": true }.trajectoryBundleis absent or false, no trajectory bundle is written.recording statusincludes{ trajectoryBundle: { enabled, trajectory_id?, dir? } }when a bundle is active.recording stopfinalizesreport.jsonbefore returning.Redaction
Reuse the redaction rules from
TaskJournal:Report
report.jsonaggregates:Acceptance criteria
events.jsonlis append-only and has strictly increasingseqvalues.oc_assertis linked intocontracts/<seq>.jsonwhen a bundle is active.oc_checkpoint savewrites or references a checkpoint artifact when a bundle is active.report.jsonis generated on stop and includes counts for tools, failures, progress, and contracts.docs/observability/trajectory-bundles.md.Real verification after merge using OpenChrome
Setup
Start OpenChrome normally and connect a real Chrome session. Then run:
https://example.com.oc_assertforh1containingExample Domain.oc_checkpointwith one completed and one pending step.oc_assertfor textNotPresent.Scenario 1 — bundle files exist
Pass: the returned
trajectory_iddirectory containsmeta.json,events.jsonl,contracts/,checkpoints/, andreport.json.Scenario 2 — event sequence is valid
Pass: command exits 0.
Scenario 3 — contract evidence is linked
Pass:
report.json.contracts.pass === 1,report.json.contracts.fail === 1, andcontracts/*.jsoncontains both assertion results with evidence details.Scenario 4 — checkpoint is linked
Pass:
checkpoints/*.jsonincludes the saved task description, completed steps, pending steps, current URL, and tab state.Scenario 5 — redaction
On a local fixture page, type a password value
super-secret-fixture-password, then stop the bundle.Pass: no matches.
Scenario 6 — default-off invariance
Run the same simple recording without enabling trajectory bundles.
Pass: no new
~/.openchrome/trajectories/<new-id>directory is created; existing recording report behavior remains unchanged.Out of scope
Dependencies / references
src/journal/task-journal.ts,src/tools/checkpoint.ts,src/recording/*, andsrc/contracts/*concepts.Reviewer checklist for ambiguity
Curated scope, overlap handling, and verification checklist
Scope classification
feat/1059-cua-adoption). Continue there; do not create a separate trajectory implementation.Overlap and conflict resolution
Implementation checklist
Success criteria
Post-merge OpenChrome live verification checklist