Skip to content

Add managed Trrack provenance APIs#1306

Open
JackWilb wants to merge 2 commits into
devfrom
codex/issue-659-managed-trrack
Open

Add managed Trrack provenance APIs#1306
JackWilb wants to merge 2 commits into
devfrom
codex/issue-659-managed-trrack

Conversation

@JackWilb

Copy link
Copy Markdown
Contributor

Summary

  • add useRevisitTrrack for React stimuli and Revisit.createTrrack for website/iframe stimuli
  • subscribe before stimulus layout effects, capture the initial node plus every apply/undo/redo/direct traversal, and clean up listeners on unmount or navigation
  • send source-timestamped traversal history through a provenance-only store action instead of coupling provenance writes to answer validation
  • keep manual provenance submission and graph-only replay as deprecated compatibility paths for existing studies and historical data
  • migrate built-in response/Vega tracking and all official React, HTML, and Svelte examples to the managed APIs
  • regenerate config schemas and add lifecycle, transport, store, replay, and browser-demo coverage

Root cause

reVISit could only observe graph snapshots that a study explicitly submitted. A private Trrack instance could therefore apply, undo, or redo without the platform seeing the transition, and graph node creation order alone cannot reconstruct revisits to existing nodes.

The managed APIs make reVISit responsible for instance creation and observation while leaving study state and action definitions in study code.

Compatibility

  • Existing setAnswer({ provenanceGraph }) and Revisit.postProvenance(...) integrations continue to work through the store-ingestion fallback and are marked @deprecated.
  • Historical provenance without traversal events continues through the graph-only replay fallback, which is also marked @deprecated.
  • No historical timing is fabricated and no dependency is added.

Stacked dependency

This PR targets codex/issue-1284-trrack-replay and must merge after #1305. It builds on #1305's traversal data model and replay compatibility work, then reduces its store-ingestion recording to the deprecated manual-integration fallback.

Validation

  • yarn generate-schemas
  • yarn typecheck
  • yarn lint
  • focused Vitest suite: 110 passed
  • yarn unittest --run: 1,859 passed, 1 skipped
  • yarn build
  • git diff --check

The updated Playwright demo coverage will run in CI; it was not run locally per the repository testing policy.

Closes #659

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

A preview of bbc243a is uploaded and can be seen here:

https://revisit.dev/study/PR1306

Changes may take a few minutes to propagate.

@JackWilb JackWilb linked an issue Jul 16, 2026 that may be closed by this pull request
16 tasks
@JackWilb

Copy link
Copy Markdown
Contributor Author

Can we pass through in StimulusParams?

Base automatically changed from codex/issue-1284-trrack-replay to dev July 17, 2026 17:00
…d-trrack

# Conflicts:
#	src/components/response/ResponseBlock.tsx
#	src/components/response/tests/ResponseBlock.spec.tsx
#	tests/demo-trrack.spec.ts
@JackWilb
JackWilb marked this pull request as ready for review July 17, 2026 17:04
@JackWilb
JackWilb requested a review from jaykim1213 July 17, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable undo/redo based on track in revisit stimuli

2 participants