BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Barnowl · Find clock reversals and gaps in an audit export

Inspect a supplied audit export for sequence gaps, replays and clock reversals.

Find clock reversals and gaps in an audit export

Sorting an export by timestamp can conceal a clock rollback. Audit receipt order and sequence continuity as separate signals. The sample skips sequence 41, repeats 42 and ends with a backward clock step. The result identifies the reversed row.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-barnowl.git
cd blyx-barnowl
blyxc native-run project.blyx -- "40,42,42" "10,14,12"

API and return values

Returns [gap count, nonadvancing IDs, backward clock steps, first reversed row, clean flag]. Preserve original receipt order; a gap is an observation for investigation. Invalid input returns an empty vector.

ArgumentAccepted input
idsVector of: nonnegative exact integer
timesVector of: exact signed integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
1
1
1
2
0
Open in the full playground →

Practice

Change ids = [1, 2], times = [4, 4]. Predict the result, then run the program.

Hint

Returns [gap count, nonadvancing IDs, backward clock steps, first reversed row, clean flag]. Preserve original receipt order; a gap is an observation for investigation.

Worked solution

The result vector is [0, 0, 0, -1, 1]. Compare its fields with the return layout in the API section.

Find

    let ids = [40, 42, 42];

Replace with

    let ids = [1, 2];

Find

    let times = [10, 14, 12];

Replace with

    let times = [4, 4];

Output after the change

0
0
0
-1
1