Skip to content

Record computer-use actions and diagnostic evidence #20

Closed

Description

@ElbertePlinio

Parent: #17
Depends on: #19

Goal

Record a coherent, privacy-safe timeline of what the agent did and what the computer returned, producing both machine-readable evidence and a replayable human HTML filmstrip.

Storage contract

Do not let multiple CLI/MCP/bridge processes race on manifest.json.

Each computer-use run has:

  • manifest fields evidenceVersion: 1 and actionLog: "actions.jsonl"
  • append-only actions.jsonl as the authoritative timeline
  • an atomically-created session-scoped active-run pointer
  • static report.html filmstrip plus the existing text summary

Existing manifests without evidence fields remain valid. Rendering sorts by timestamp plus action ID and assigns display step numbers.

Each sanitized action contains:

  • actionId, source, tool, sessionId
  • startedAt, durationMs, status
  • optional allowlisted target metadata
  • artifact paths
  • redacted error summary

Privacy contract

  • Typed/fill values persist only as length and input type.
  • Network failures persist only method, origin/path without query, status, resource type, timing, and sanitized error text.
  • Persist no request/response headers or bodies.
  • Strip Cookie, Set-Cookie, Authorization, session/JWT/CSRF/OTP values, bare JWTs, query tokens, and CDP websocket capabilities.
  • Do not auto-capture screenshots for typing/fill/password/OTP/payment actions.
  • Screenshot pixels cannot be redacted; document this and allow evidence capture to be disabled.

Bounds

  • Maximum auto-generated evidence: 100 MiB per run.
  • After the cap, continue metadata and mark evidence truncated.
  • Retain the latest 20 finalized computer-use runs per project.
  • Never prune active/running runs.

Checklist

  • Active-run pointer and append-only action journal
  • Structured evidence redaction
  • MCP tool instrumentation
  • DevTools relay instrumentation
  • Screenshot capture policy
  • Console/network failure metadata
  • Backward-compatible manifest/resource rendering
  • HTML filmstrip report
  • 100 MiB cap and 20-run pruning
  • Concurrent append and planted-secret tests
  • README and docs/releases/UNRELEASED.md
  • PR/review

Validation

  • bun run typecheck
  • focused core/run/MCP/relay tests
  • bun run test
  • bun run test:coverage
  • bun run build
  • concurrent writers lose zero actions
  • old manifests still list and render
  • planted cookies, headers, query tokens, JWTs, OTPs, typed passwords, and CDP GUIDs are absent from the entire run directory
  • sensitive actions create no automatic screenshots
  • cap and pruning are deterministic
  • a failed browser flow produces a useful sanitized report.html

Current status: Completed
Next: complete — delivered across PRs #33, #35, #37, #38, #40, and #42.

Activity

  1. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Agent plan

    Goal: add a privacy-safe, append-only computer-use timeline and static HTML filmstrip without allowing MCP and relay processes to race on manifest.json.

    No feature flag. Every slice keeps main releasable. evidence.enabled: false is the product off switch, defaulting to enabled; it is not rollout gating.

    Decisions

    • actions.jsonl is authoritative; manifest.json is single-owner summary data written only at create/finalize.
    • Manifest additions are optional: evidenceVersion: 1, actionLog: "actions.jsonl", and truncation metadata. Old runs remain valid.
    • Active run resolution uses a session-scoped, confined pointer claimed atomically with wx; racing processes adopt the winner and do not create orphan runs.
    • Every action is sanitized before persistence. Unknown target fields are dropped, not copied.
    • Typed/fill values always persist as length + input type only. Sensitivity classification additionally suppresses automatic screenshots.
    • Network failures keep only method, origin/path without query, status, resource type, timing, and sanitized error. No headers or bodies.
    • Journal records are bounded and appended as one newline-terminated write. Cross-process stress tests must prove zero lost or corrupt actions.
    • The 100 MiB cap applies to auto-generated evidence; metadata continues with a deterministic truncation marker.
    • Retention removes only old finalized evidence runs. Active/running and legacy runs are never pruned.
    • Rendering sorts by startedAt then actionId; display step numbers are assigned at render time.
    • report.html consumes already-sanitized records, escapes all page-controlled text, uses a restrictive CSP, and makes no external requests.

    PR plan

    • PR 1 — Structured privacy sanitizers

      • Depends on: none
      • Strengthen secret patterns: cookies, headers, bare JWTs, query tokens, OTP/CSRF, CDP capability URLs
      • Add allowlisted target, typed-value, URL, network-failure, and error sanitizers
      • Validation: planted-secret table + recursive security sweep
    • PR 2 — Evidence storage foundation

      • Depends on: none; may proceed in parallel with PR 1
      • Optional manifest v1 fields, append-only journal, atomic active-run pointer, evidence.enabled, 100 MiB accounting/truncation, finalized-run retention primitives
      • No producers yet; current behavior remains unchanged
      • Validation: separate-process concurrent writers, pointer races/stale recovery, cap, pruning, and legacy manifests
    • PR 3 — Evidence rendering and confined resources

      • Depends on: PR 1 + PR 2
      • Backward-compatible text summary, static escaped/CSP report.html, actions/report MCP resources, deterministic ordering
      • Validation: legacy fixtures, XSS cases, symlink confinement, planted-secret HTML sweep
    • PR 4 — MCP tool instrumentation

      • Depends on: PR 1 + PR 2
      • Record sanitized desktop/Android/session actions into the active journal; associate screenshot artifacts; finalize/clear pointer on destroy/reap
      • Preserve current one-shot screenshot behavior when no active evidence run exists
      • Validation: exact action records, no typed-value leakage, no sensitive auto-screenshots, disabled-config behavior
    • PR 5 — DevTools relay instrumentation

      • Depends on: PR 1 + PR 2; may proceed in parallel with PR 4
      • Wire existing before-forward/after-response hooks, correlate IDs, record sanitized status/console/network metadata without mutating or delaying protocol frames
      • Hook failures drop evidence and emit only redacted stderr; stdout remains protocol-only
      • Validation: concurrent MCP+relay writers, overlapping IDs, cancellation/errors, planted headers/bodies/query tokens/JWTs/CDP GUIDs, real failed-request smoke
    • PR 6 — Final integration, docs, and proof

    Full validation

    • bun run typecheck
    • focused core/run/MCP/relay tests per slice
    • bun run test
    • bun run test:coverage
    • bun run build
    • recursive grep of the entire run directory finds zero planted cookies, headers, query tokens, JWTs, OTPs, typed passwords, or CDP GUIDs
    • failed browser flow produces a useful sanitized report.html

    Current status: Planned
    Next action: start PR 1 and PR 2 as independent foundation worktrees.

  2. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Implementation started in two independent foundation worktrees:

    • PR 1 branch: feat/evidence-sanitizers
    • PR 2 branch: feat/evidence-core

    Both are additive-only and may proceed in parallel. No producer will persist evidence until both privacy and storage foundations are merged.

    Current status: In progress
    Next: implement and independently validate both foundation slices.

  3. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 1 opened: #33 — structured privacy sanitizers

    • Cookie/header/JWT/query/session/OTP/CSRF/CDP redaction
    • URL/error/typed-target/network sanitizers
    • Adversarial privacy review and fixes
    • Full local validation: 71 files, 820 passed / 2 skipped
    • Required CI
    • Merge

    PR 2 evidence storage remains local and will be rebased after #33 merges because both foundations touch core exports/release notes.

    Current status: PR 1 in review
    Next: ship #33, then rebase and ship PR 2.

  4. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 1 merged: #33 — structured privacy sanitizers.

    PR 2 (feat/evidence-core) is rebased onto main and locally validated:

    • Atomic active-run pointer and append-only journal
    • 100 MiB cap with recoverable exactly-once truncation marker
    • Finalized-run retention and legacy manifest compatibility
    • Focused core suite: 237 passed
    • Full suite + coverage: 893 passed / 2 skipped
    • Typecheck and build
    • Multi-model review
    • PR / required CI / merge

    Current status: PR 2 review in progress
    Next: resolve any review findings, then open and ship PR 2.

  5. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 2 opened: #35 — evidence storage foundation

    • Optional manifest fields and evidence.enabled
    • Atomic active-run pointer
    • Append-only journal with recoverable cross-process lock and torn-tail repair
    • 100 MiB truncation and 20-finalized-run retention primitives
    • Multi-model review; both high findings fixed and independently verified
    • Local validation: core 239/239; full + coverage 895 passed / 2 skipped; typecheck/build pass
    • Required CI
    • Merge

    Known unrelated flake: #32 failed once under parallel full-suite load, then passed in isolation and on the full rerun.

    Current status: PR 2 in CI
    Next: merge #35 when required checks are green, then start dependent rendering/producer slices.

  6. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 2 #35 is review-clean and locally green, but merge is blocked by the existing Xvfb race in #32. CI failed three attempts in the same unrelated browser startup test: once during test, then twice during test:coverage; the other phase passed on reruns. Isolated browser tests and local full test/coverage pass.

    Current status: PR 2 blocked on required CI
    Next: resolve #32 or obtain a genuinely green required run; do not merge while the check is failing.

  7. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Progress update:

    PR 2 merged as b608900.

    Foundation now on main:

    • session-scoped active-run pointer
    • append-only, crash-recoverable action journal
    • 100 MiB cap with exactly-once truncation marker
    • 20-finalized-run retention
    • backward-compatible manifest fields
    • structured privacy sanitizers

    Current status: In progress
    Next: PR 3 — rendering and confined resources. Producer/instrumentation slices remain deferred until that slice is ready.

  8. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 3 started in feat/evidence-rendering.

    Scope:

    • shared deterministic action ordering + backward-compatible Markdown timeline
    • escaped, no-script report.html with restrictive CSP and no external requests
    • confined MCP resources for actions.jsonl and report.html
    • legacy-run compatibility, XSS/planted-secret, malformed journal, and symlink tests

    No producers or instrumentation in this slice. PRs 4–5 remain deferred.

    Current status: PR 3 implementation
    Next: add core rendering primitives and focused tests, then wire resource/report consumers.

  9. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 3 opened: #37

    Progress:

    • deterministic Markdown action timeline with legacy compatibility
    • escaped no-script report.html with restrictive CSP
    • confined screenshots and MCP actions/report resources
    • malformed, missing, symlink, planted-secret, XSS, and parent-directory-swap coverage
    • typecheck/build; full + coverage suites: 916 passed / 2 skipped
    • serious local review and targeted fix verification clean
    • required CI
    • merge PR 3

    PRs 4–5 remain deferred. No action producers or instrumentation are included in this slice.

  10. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 3 merged: #37

    • evidence rendering and confined MCP resources
    • current HEAD locally review-clean
    • required CI passed
    • merged as 846dfe4

    Next: PR 4 — MCP action producer instrumentation. PR 5 DevTools relay instrumentation remains deferred until PR 4 is ready.

  11. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Progress update — PR 4 MCP instrumentation:

    • Instrument desktop, Android, and session mutation tools
    • Reuse one active evidence run per session
    • Associate explicit screenshots without implicit capture
    • Finalize on destroy; fail-finalize on dead-session reap
    • Add privacy, disabled-mode, failure-isolation, and lifecycle tests
    • Typecheck, build, full suite (921 passed / 2 skipped)
    • Coverage suite (926 passed / 2 skipped; thresholds met)
    • Local review
    • Required CI
    • Merge PR 4

    PR: pending
    Blocked: none
    Next: complete local review, then open PR.

  12. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 4 opened: #38

    • Implementation and regression coverage
    • Full suite and coverage thresholds
    • Two independent changed-HEAD local reviews clean
    • Required CI
    • Merge PR 4

    Blocked: none
    Next: watch CI, resolve findings, merge, then start PR 5.

  13. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 4 merged: #38

    • MCP action producers
    • Required CI green
    • Merged as 9fac03d
    • PR 5 DevTools relay instrumentation
    • PR 6 final integration/proof

    Blocked: none
    Next: implement PR 5 on fresh main.

  14. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 5 started on feat/devtools-evidence from merged PR 4.

    Scope:

    • DevTools tools/call request/response correlation
    • Privacy-safe targets and typed-value metadata
    • Explicit inline PNG screenshot association
    • Sanitized console and network-failure diagnostics only
    • Evidence failures remain relay-transparent

    Flag decision: no feature flag; this is the next-release slice and follows existing evidence.enabled product configuration.
    Blocked: none

  15. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 5 progress:

    • Correlate DevTools tool requests/responses
    • Sanitize targets, typed values, errors, console/network diagnostics
    • Associate explicit inline PNG screenshots
    • Bound pending calls and diagnostic fan-out
    • Preserve relay behavior when evidence fails/disabled
    • Build + full suite
    • Coverage: 76 files, 938 passed / 2 skipped; thresholds met
    • Local review
    • Required CI
    • Merge PR 5

    Blocked: none
    Next: resolve local review, open PR.

  16. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 5 ready to ship:

    • Correlate DevTools tool calls/responses
    • Strict privacy allowlists and fixed failure summaries
    • Confined inline PNG capture with cap-safe cleanup
    • Bounded network/console diagnostics and failure reporting
    • Build + full suite: 76 files, 942 passed / 2 skipped
    • Coverage thresholds met
    • Two independent changed-HEAD reviews clean
    • Required CI
    • Merge PR 5

    Blocked: none
    Next: open PR and run CI.

  17. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 5 merged: #40

    • DevTools relay evidence instrumentation
    • Required CI green
    • Merged as 3e5c606
    • PR 6 final integration/proof

    Blocked: none
    Next: implement and validate PR 6.

  18. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 6 started on feat/evidence-integration from merged PR 5.

    Scope:

    • end-to-end failed browser-flow evidence → finalized HTML report proof
    • browser session recreation → fresh relay target resolution proof
    • verify cap/retention contracts through existing full-suite coverage
    • document evidence files, resources, limits, retention, opt-out, and screenshot-pixel caveat
    • final recursive planted-secret sweep and release validation

    This final PR will close #20.
    Blocked: none.

  19. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 6 implementation complete on feat/evidence-integration:

    • Failed DevTools flow finalizes into an automatic secret-free HTML report
    • Session destroy and dead-session reap publish report.html
    • Browser session recreation resolves the fresh relay target
    • README/SECURITY evidence, retention, cap, opt-out, and screenshot caveat
    • Build + full suite: 77 files, 944 passed / 2 skipped
    • Coverage thresholds met
    • Changed-HEAD local review
    • Required CI
    • Merge PR 6
      Blocked: none
      Next: local review, then open PR.
  20. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 6 local gate complete:

    • Build + full suite: 77 files, 945 passed / 2 skipped
    • Coverage thresholds met
    • Two independent changed-HEAD reviews clean
    • Review fixes: reject mismatched manifest/pointer identity; refresh the finalized report after session_destroy is journaled
    • Focused regression coverage for both fixes
    • Required CI
    • Merge PR 6
      Blocked: none
      Next: commit, open PR, run CI.
  21. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR 6 opened: #42

    • Implementation + regression coverage
    • Build/full suite/coverage
    • Two independent changed-HEAD reviews clean
    • Required CI green
    • Merge PR 6
      Blocked: none
      Next: watch CI, resolve findings, merge.
  22. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Completed: PR #42 merged after required CI passed.

    All six evidence slices are merged:

    Final validation: 77 files, 945 passed / 2 skipped; coverage thresholds met; two independent changed-HEAD reviews clean.
    Blocked: none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions