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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cr_proc-0.1.7.tar.gz
  • Upload date:
  • Size: 16.0 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.7.tar.gz
Algorithm Hash digest
SHA256 3a0440f9169bdc0aeb37c732614c69b006c00270c0afc7dea70af4d8fa5e09c6
MD5 720dfb4af63b7a101de696021f46786b
BLAKE2b-256 e764c1d38ab7623a64ff61ce287a13af7aefe4510e56ece24a2d3c56be39a4c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cr_proc-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c54a1c6339be5abc693c2e7a54c9b586acdc5e09e0ea23f57e5cb3868c429681
MD5 8b316bba9ac2feeee463d19938e77894
BLAKE2b-256 66f4c25b963fbd8c4e0c53d5c08c8498d2d05830a84599beea94ae3120d07fba

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