Skip to content

Add provenance metadata to browser profiler JSON export - #339

Merged
yakew7 merged 3 commits into
yakew7:mainfrom
lovishmenaria14-gif:web-profiler-provenance
Aug 29, 2026
Merged

Add provenance metadata to browser profiler JSON export#339
yakew7 merged 3 commits into
yakew7:mainfrom
lovishmenaria14-gif:web-profiler-provenance

Conversation

@lovishmenaria14-gif

Copy link
Copy Markdown
Contributor

Changes

  • Adds Fair Code version to browser exports.
  • Records the JavaScript engine used for the export.
  • Computes a SHA-256 digest from the original uploaded file bytes using crypto.subtle.
  • Includes the active profiler parameters and manual column overrides.
  • Handles in-memory datasets by returning a null dataset hash with an explanatory note.

Verification

  • Tested with an uploaded CSV file.
  • Confirmed that the exported JSON contains a sha256:<hex> dataset hash.
  • Confirmed the working tree is clean.
  • Confirmed the branch only changes assets/profiler-ui.js relative to main.

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@lovishmenaria14-gif is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Hey @lovishmenaria14-gif, your first PR on Fair Code, that's awesome, thank you.

This project is about making AI more accountable, and contributions like yours are what keep that work going. We'll review your changes shortly.

If you haven't already, give the contributing guide a quick read: it covers how audits are structured and what we look for in a review.

@github-actions

Copy link
Copy Markdown

@yakew7 @ahmdkaml - new PR touching a path you own, please review.

@ahmdkaml

Copy link
Copy Markdown
Collaborator

Changes approved. The JS provenance path now covers the missing part of #327. One minor consistency issue: the SPEC/earlier implementation defines the engine value as python / js, while this uses javascript; please use js to keep the exported schema consistent.

@yakew7
yakew7 merged commit 3834308 into yakew7:main Aug 29, 2026
1 check failed
yakew7 added a commit that referenced this pull request Aug 29, 2026
…ple data

PR #339 added a provenance block to the "Copy as JSON" export, hashing
currentFile - set once in readFile() and never updated afterward. The
sample-data button and the ?demo auto-load both call runText() directly,
bypassing readFile() entirely, so after a real upload followed by
"Try it with a sample dataset," currentFile still pointed at the old
real file while currentResult reflected the sample data. The exported
provenance.dataset_hash would silently misrepresent which file produced
the numbers.

file now flows through runText()/runTable() as an explicit parameter
instead of being set as a side effect in readFile(), so every path that
reaches runTable() sets currentFile to the correct value (or null for
in-memory data) rather than inheriting whatever the last real upload
left behind.

Co-Authored-By: Lovish Menaria <lovishmenaria14008@gmail.com>
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.

3 participants