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.6.tar.gz (15.5 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.6-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cr_proc-0.1.6.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cr_proc-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c4cc7072292dfea008498dd7a5e132c4ab2f498a494c7e83eb58455ea81644f9
MD5 713c81b81536df0dbcaff50a6f41b717
BLAKE2b-256 0be44be894ffe58565895cccefa03c4f16a9d238855ea71df8a1c1af45e82bf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cr_proc-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cr_proc-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 466e0b836e3e2294fff00ec9f1f0fc061a33c8dd513d6ce91394a54d20bcc97c
MD5 2492d8bc447aa5b26101553ea4bf212c
BLAKE2b-256 f59468fdd54da9d8a5c5e839eb62be40a543e188630c03e1ddd9cfc3dd156a0a

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