Skip to main content

No project description provided

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cr_proc-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 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.0.tar.gz
Algorithm Hash digest
SHA256 48b082efd6fd1f0ef452435941b181343c13289b1f9e8fe339532fe198f24d73
MD5 c3fc86c7b55ebcf22edff97788b9cc59
BLAKE2b-256 47052a20c0ffe8b8fc0ed8066472dcfab5b041d5c2e596d76b1cce02efe7ffba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cr_proc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9aff7bf7f7edaf59df1c407fd0e2fe3f7f32a154e17ae642355a72d76e3ccec5
MD5 c277ce5096ef2d97633c6799a7130424
BLAKE2b-256 715c6aa517e10ead1638d94a5176c798abe1d57f71793dc7a6d8e3eb54e9bd01

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