DEV Community

Cover image for ChessPulse: review the player, not only the moves
Kshitij
Kshitij

Posted on Edited on

ChessPulse: review the player, not only the moves

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Most chess players know tilt. You lose a game, then another, and the next one is worse, because your head is still on the last one. Some players queue ten or fifteen games in a row. A bad run can undo a good evening.

chess.com can show you the moves that lost the game. A PGN records the moves and the clock, but not your pulse, so it cannot show what you were like when you played them.

ChessPulse is a local desktop app that puts both on one timeline. It is built for bullet, blitz and rapid players, and it is free and open source. You play on chess.com while the app reads your pulse from the webcam through the Presage SmartSpectra SDK. Afterwards you paste your games, and the app scores your moves, lines them up with the pulse, and writes a report.

It works on three levels:

  1. Pulse. The SmartSpectra SDK measures your pulse on your computer while you play.

  2. Game review. Stockfish 19 scores every move of your pasted games locally, at depth 12.

  3. Explanation. An optional AI reply answers your questions about the session. It receives your question, your PGNs and the summary numbers from the first two levels. It never receives video, raw pulse samples or file paths. The reply is labelled as inferred text. The app works fully without an API key.

ChessPulse does not detect tilt, mood or stress, and it does not diagnose anything. It shows where your pulse and your mistakes happened together, and you decide what that means.

The report gives you:

  • A summary header with your baseline pulse, the elevated threshold, pulse coverage and blunders. Each one has a plain definition next to it.

  • One verdict line that says how many blunders happened and whether any of them came while your pulse was raised.

  • The Pulse and Play timeline, with pulse, game boundaries, move loss and think time on one clock.

  • Move Quality, overall and per game. Each large mistake links back to its place on the timeline.

  • Accuracy for two pulse bands. "Settled" means your usual pulse. "Elevated" means 10 bpm or more above your baseline. A band with fewer than five scored moves shows "Insufficient" instead of a number.

  • A short between-games note when your pulse stays raised after you mark a game as ended.

  • A refusal, not a weak report, when the pulse signal covers less than 70% of the session.

Demo

Passed run: 10 bullet games

Session 01M829E6SVWDNHB7XH84E4TAZB: 10 games at 1+0, 22 minutes 19 seconds, 88.2% pulse coverage, baseline 81.4 bpm, elevated threshold 91.4 bpm.

  1. Home. The app lists the two example sessions under "Example sessions", apart from my own. Both are read-only.

  2. Setup. The app checks the camera, the API key and the light. It asks for consent before it opens the camera. The camera stays off until I press "Allow the camera".

Setup and consent

  1. Paste. After I stopped sensing, I shared each game from chess.com as PGN with the clock timestamps turned on. Pasted games are checked before scoring.

Paste PGNs

Pasted games

  1. Summary. The report opens with the verdict: 3 blunders, none of them while my pulse was elevated. Settled accuracy was 91% over 216 moves. The elevated band had only 3 moves, so it shows "Insufficient". The verdict also points to the long wait between games 9 and 10.

Report summary

  1. Timeline. The pulse trace sits above the game bands, so I can see where each game starts and ends and what my pulse was doing at the time.

Pulse and Play timeline

  1. Move Quality. The report scored 242 moves. The largest losses are listed with links to the timeline.

Move Quality

  1. AI explainer. This step is optional. Nothing is sent until I press "Generate explanation". The reply is shown as plain text, labelled INFERRED.

AI Session Explainer

An explainer answer

The between-games note did not appear in this session. I checked the saved samples against the rule: the highest one-minute median before a game end was 88.1 bpm, below the 91.4 bpm line.

Failed run: 3 blitz games

Session 01M82X8MPPR67CS08YQGKP5QR1: 3 games at 3+2, 16 minutes 51 seconds, 9.3% pulse coverage.

  1. Setup and sensing. The session ran with the camera on, but the chest was out of frame for most of it. The framing counts show chest out of frame in 25,140 of 30,018 checks, which is 84%.

  2. Stop. Sensing ended by my choice after the three games.

  3. Review. The report refuses to compare pulse with moves below 70% coverage, so it shows the reason instead of a weak report.

Withheld review

I include this run because it shows the refusal working. The session's own PGNs were not saved, so opening it leads to the paste screen. The coverage check uses only the pulse data, so pasting any three chess.com games with clock times into this session gives the same refusal.

Run it locally

Requirements:

  • Linux. It is the only platform I have tested.

  • Node 22 and npm.

  • A display and a webcam.

  • A SmartSpectra API key. You can register here.

  • Stockfish 19.0.1 comes with the stockfish npm package, so there is nothing separate to install.

Steps:

git clone https://github.com/kernelKain/chesspulse.git
cd chesspulse
npm install
cp .env.example .env       # then put SMARTSPECTRA_API_KEY in .env
npm run doctor             # checks Node, .env, the key, the camera, Stockfish and the data folder
npm test
npm run build && npm start
Enter fullscreen mode Exit fullscreen mode

npm run dev opens the window against the local dev server. If Electron exits because its sandbox helper is not setuid, run npx electron --no-sandbox . instead. This flag turns off Electron's sandbox, which the Architecture section below relies on, so use it only for development.

The AI explanation is optional. Set CP_AI_PROVIDER, CP_AI_KEY and CP_AI_MODEL in .env to turn it on. Without them, the rest of the app works.

For a usable pulse reading, sit so you are the only face in frame, facing the camera, with your upper chest visible. Use a lamp in front of you. A dark room lowers the confidence of each reading.

Repository: https://github.com/kernelKain/chesspulse

Under the Hood: How Pulse Becomes a Report

The app is a loop of three layers, with the report at the end.

Three layers, one report

Layer 1: pulse. The main process opens the camera through the SmartSpectra SDK. The web page never asks for the camera. Each reading comes with a confidence score and a stable flag. A reading counts only when it is stable and its confidence is at least 50 out of 100. Weaker readings stay in the saved file, but they are not treated as zero. Your baseline is the median of the usable readings in the first 60 seconds. Coverage is the share of the session that has usable readings. Each reading covers the time until the next one, up to one second, so a longer gap shows as a gap. Below 70% coverage, the app refuses to build the report.

Layer 2: game review. The pasted PGNs are parsed into moves, clock times and results. Stockfish 19.0.1 scores each position at depth 12 in a worker thread, so the window stays responsive. The app works out the centipawn loss for each move, then places each move on the pulse timeline using the game marks you set. Each move falls into the settled or elevated band. Accuracy is worked out per band. A band with fewer than five scored moves shows "Insufficient", because a percentage from a handful of moves would look more certain than it is.

Layer 3: explanation. This layer is optional and only runs when you press "Generate explanation". It sends your question, your PGNs and the report's summary numbers to the provider you configured. It never sends video, images, raw pulse samples, logs or file paths. The AI reply is plain text, labelled INFERRED. If the reply contains a number that the report does not hold, the app withholds it. The AI cannot change any value in the report.

The between-games note comes from layer 1. When you press "Game ended", the app takes the median of the last minute of usable readings. If that median is at least 10 bpm above your baseline, one line appears with the measured numbers and suggests a break. Pressing "Next game started" removes it. The app does not call that number a loss, and it does not describe your mental state.

The app has three honest limits:

  • The pulse trace is smoothed, so it lags the moment that caused it.

  • You mark the game boundaries by hand, one click per game.

  • Scoring uses Stockfish at depth 12 for speed, so it is less exact than a deep analysis.

Architecture

How the app is built

The main process is the trusted side. It holds the API keys, opens the camera, writes the session files and runs the engine. The renderer is a React page in a sandbox. It has no Node access and no camera access. The two sides talk only through a contextBridge channel table, and every message is checked against a schema before it is used. The page can show a preview because the main process sends it a small copy of the SDK's own video output. The camera is never opened twice.

Only two outside services can receive anything: the SmartSpectra servers, which check the API key and subscription, and the AI provider you choose, which is used only after you press "Generate".

Data flow

From a session to a report

During play, the camera feeds the SDK, which produces pulse samples. The samples go through a coverage gate. After you stop, the pasted games are scored and aligned to the same timeline. Accuracy per band goes into the report. The AI explanation is the only optional branch, and it reads summary numbers, not the samples.

Consent and Data Handling

I wanted ChessPulse to be clear about what it records and where that goes. Here is the full list.

Camera. The camera stays off until you press "Allow the camera". While sensing, the screen shows a "Sensing" indicator. If your webcam has its own indicator light, it turns on too. You can revoke consent at any time. Revoking releases the camera and stops the open session.

What is stored. No video or image is ever written to disk. Frames are handled in memory for measurement and the preview. Each session is a folder under ~/.local/share/chesspulse on your computer:

  • meta.json has the start time, the time control, the game marks and the framing counts.

  • samples.ndjson has timestamped pulse numbers with their confidence values.

  • games.json has the PGNs you pasted, exactly as pasted.

  • report.json has the computed report.

The app also writes a redacted log file, capped at 512 KB, with no PGNs, samples or keys. It remembers the player name you chose, in ~/.config/chesspulse, so the next paste can select it.

Retention and deletion. Nothing expires on its own. Delete a session from the Sessions screen, and its folder is removed. Deleting ~/.local/share/chesspulse removes every session and the log. Deleting ~/.config/chesspulse removes the remembered name. There is no account and no cloud copy.

Sharing. Nothing leaves your computer unless you export it. Export writes the report to a JSON file you choose, and that file contains no pulse samples. "Copy diagnostics" puts a plain-text support summary on the clipboard. It is built from app metadata and redacted log lines.

Who receives data.

  • Presage SmartSpectra SDK. Pulse is computed on your computer. The SDK contacts Presage's server to check your API key and subscription, so sensing needs a connection. ChessPulse turns off the SDK's telemetry (enableTelemetry: false), which covers session summaries and device-readiness reports. Presage's privacy policy and telemetry page govern the data their service handles.

  • Stockfish. It runs locally. Scoring a session makes no network request.

  • AI provider, optional. Nothing is sent when a report opens. When you press "Generate explanation", the provider receives your question, your PGNs and the report's summary numbers. It never receives video, images, raw pulse samples, logs or file paths. Your key is sent only to authenticate the request. A request times out after 30 seconds. It is retried once only after a provider server error or a failed connection, never after a timeout. Your provider's own retention policy applies to what it receives. If you do not add a key, no request is made.

Example sessions. The two example sessions in demo/ contain public chess.com usernames and game links from my own games. They are read-only in the app.

Keys. The SmartSpectra key and any AI key are read from the .env file or the environment, and only the main process reads them. They are never written to a log, a report or a session file.

Not medical. ChessPulse does not diagnose, treat or advise on health. It does not present pulse values as health information, and it makes no claim about stress or mental state.

Prize Categories

I am entering Best Thoughtful Real-World Use.

The people this is for are bullet, blitz and rapid players who review their games and want to know whether a bad session came with a raised pulse. I built it for that question, and each part of the category description has a concrete answer in the app:

  • A clear real-world need. The report puts pulse next to the moves of the same session. It shows whether a bad stretch came with a raised pulse. chess.com's review has no pulse data to answer that.

  • Consent. The camera is off until you allow it. The sensing indicator stays on while the camera runs. Consent can be revoked at any time.

  • Responsible data handling. Video is never stored. Everything stays on your computer. Telemetry is off. The AI is optional and receives only summary numbers and PGNs.

  • Honest refusals. Below 70% coverage, the app refuses to build a report. A band with too few moves shows "Insufficient" instead of a number. The app would rather show nothing than a confident guess.

  • Usability. Setup checks the camera, the key and the light before the session starts. The consent and paste steps are written in plain language for players.

Agent Session

I used Entire to record my AI coding sessions for this project. Entire saves each session as a checkpoint in git refs, and it pushes those refs to the repository's origin remote. The checkpoints, and the transcripts inside them, are therefore public on GitHub next to the code.

Public pages for this project:

I wanted one place for every coding session, across the tools I use. Cursor and OpenCode are supported by Entire directly. Kiro needed an external adapter, and Entire's support for it is less complete than for the others. GitHub Copilot CLI is also recorded. Entire has no VS Code Copilot integration, so those chats are not in this record. The analytics below do not include Kiro model usage, so treat its numbers as incomplete for Kiro.

Entire analytics, last 7 days

Top comments (0)