Skip to main content

A tool for processing BYU CS code recording files

Project description

code_recorder_processor

CI

This contains code to process and verify the *.recorder.jsonl.gz files that are produced by the jetbrains-recorder.

Installation

Install the package and its dependencies using Poetry:

poetry install

Usage

The processor can be run using the cr_proc command with two arguments:

poetry run cr_proc <path-to-jsonl-file> <path-to-template-file>

Arguments

  • <path-to-jsonl-file>: Path to the compressed JSONL file (*.recorder.jsonl.gz) produced by the jetbrains-recorder
  • <path-to-template-file>: Path to the initial template file that was recorded

Options

  • --time-limit MINUTES: (Optional) Maximum allowed time in minutes between the first and last edit in the recording. If the elapsed time exceeds this limit, the recording is flagged as suspicious. Useful for detecting unusually long work sessions or potential external assistance.

Example

poetry run cr_proc homework0.recording.jsonl.gz homework0.py

With time limit flag:

poetry run cr_proc homework0.recording.jsonl.gz homework0.py --time-limit 30

This will flag the recording if more than 30 minutes elapsed between the first and last edit.

The processor will:

  1. Load the recorded events from the JSONL file
  2. Verify that the initial event matches the template (allowances for newline differences are made)
  3. Reconstruct the final file state by applying all recorded events
  4. Output the reconstructed file contents to stdout

Output

The reconstructed file is printed to stdout. Any warnings or errors are printed to stderr, including:

  • The document path being processed
  • Suspicious copy-paste and AI activity indicators

Suspicious Activity Detection

The processor automatically detects and reports three types of suspicious activity patterns:

1. Time Limit Exceeded

When the --time-limit flag is specified, the processor flags recordings where the elapsed time between the first and last edit exceeds the specified limit. This can indicate unusually long work sessions or potential external assistance.

Example warning:

Time limit exceeded!
  Limit: 30 minutes
  Elapsed: 45.5 minutes
  First edit: 2025-01-15T10:00:00+00:00
  Last edit: 2025-01-15T10:45:30+00:00

2. External Copy-Paste (Multi-line Pastes)

The processor flags multi-line additions (more than one line) that do not appear to be copied from within the document itself. These indicate content pasted from external sources.

Example warning:

Event #15 (multi-line external paste): 5 lines, 156 chars - newFragment: def helper_function():...

3. Rapid One-line Pastes (AI Indicator)

When 3 or more single-line pastes occur within a 1-second window, this is flagged as a potential AI activity indicator. Human typing does not typically produce this pattern; rapid sequential pastes suggest automated code generation.

Example warning:

Events #42-#44 (rapid one-line pastes (AI indicator)): 3 lines, 89 chars

Error Handling

If verification fails (the recorded initial state doesn't match the template), the processor will:

  • Print an error message to stderr
  • Display a diff showing the differences
  • Exit with status code 1

If file loading or processing errors occur, the processor will:

  • Print a descriptive error message to stderr
  • Exit with status code 1

Future Ideas

  • Check for odd typing behavior

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cr_proc-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cr_proc-0.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file cr_proc-0.1.1.tar.gz.

File metadata

  • Download URL: cr_proc-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cr_proc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 07eb7a9d6b7c88edd486473467eae291ecb85bc394407874910c2b6d75cb3b6b
MD5 062f86f6bbbfd1c6e8a1ea12da4120c6
BLAKE2b-256 1875ab3a9a1184a5bbad0c2a2bcb636bd202499d64e66a4654db51639d8bc42e

See more details on using hashes here.

File details

Details for the file cr_proc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cr_proc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cr_proc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52a95092c4ea3d8f4135cc44089324db1f2c8591321dd1652ef6cd275236c7a7
MD5 82f2f0ca49c21d265f43c4535ec3bfc3
BLAKE2b-256 aa0624f53c44b787fbe2b92970a0ea537e7a0f8438217947bbb44fdd5400f186

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page