Skip to content

fix: timestamp columns are sequences; add journal example (1.1.1)#65

Merged
copyleftdev merged 1 commit into
mainfrom
fix/timestamp-role-journal-example
Jun 2, 2026
Merged

fix: timestamp columns are sequences; add journal example (1.1.1)#65
copyleftdev merged 1 commit into
mainfrom
fix/timestamp-role-journal-example

Conversation

@copyleftdev

Copy link
Copy Markdown
Owner

What

Adds examples/journal_anomalies.py — a worked example of anomalyx on systemd-journal telemetry:

  • single window → point / structural / collective anomalies (e.g. per-unit CPU-usage spikes),
  • --baseline-since → distributional drift of _SYSTEMD_UNIT / PRIORITY between two windows.

It pipes journald JSON on stdin (so it content-sniffs as journal, not plain JSON) and maps each finding back to its timestamp / unit / message.

The fix it surfaced

Building it exposed a real roles gap: Role::Sequence required strict monotonicity, but journald clock columns (__REALTIME_TIMESTAMP, __MONOTONIC_TIMESTAMP, …) tie/regress just often enough to fail it — so they were classed measurement, and coll.cusum flagged their "level shift" (time advancing) and point their jumps. Pure noise.

Fix: a timestamp / ts name token now classifies a column as sequence (skipped by the value detectors), kept deliberately narrow so response_time-style measurements (which you do want outliers on) are unaffected. cad.regularity is role-agnostic, so --cadence timestamp (beaconing) still works.

No config_version change — a classifier refinement, like 1.0.1's procid; goldens unaffected (scan_basic has no timestamp column).

Verified

Journal example now shows real CPU_USAGE_NSEC spikes on user@1000.service (modz ~10) instead of timestamp noise; --baseline-since flags PRIORITY (KS) and _SYSTEMD_UNIT (χ²=122) drift between windows.

Gate

cargo-mutants 0 missed on roles.rs (39 caught / 1 unviable); fmt/clippy/full-workspace green. The example lives outside the Cargo workspace (no build/gate impact).

🤖 Generated with Claude Code

Adds examples/journal_anomalies.py — anomalies in the systemd journal (point/
structural/collective within a window, or _SYSTEMD_UNIT/PRIORITY distributional
drift between two windows via --baseline-since). Pipes journald JSON on stdin so
it sniffs as `journal`, and maps findings back to timestamp/unit/message.

Building it surfaced a real roles gap: Role::Sequence required STRICT
monotonicity, but journald clock columns (__REALTIME_TIMESTAMP etc.) tie/regress,
so they were classed measurements and coll.cusum/point flagged their
time-advancing "level shift" as noise. Fix: a `timestamp`/`ts` name token now
classifies a column as Sequence (skipped by value detectors), kept narrow so
response_time-style measurements are unaffected. cadence is role-agnostic, so
--cadence on a "timestamp" column still works. No config_version change
(classifier refinement, like 1.0.1's procid); goldens unaffected.

Verified: journal example now shows real CPU_USAGE_NSEC spikes (not timestamp
noise); drift mode flags unit/priority shifts. Gate: cargo-mutants 0-missed on
roles.rs (39 caught); full workspace green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@copyleftdev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 43 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8dc2188c-dcf1-4f0d-a716-87a635566d1e

📥 Commits

Reviewing files that changed from the base of the PR and between eaa1000 and 266f614.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • CHANGELOG.md
  • Cargo.toml
  • crates/ax-core/src/roles.rs
  • examples/journal_anomalies.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/timestamp-role-journal-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@copyleftdev copyleftdev merged commit ff93a4f into main Jun 2, 2026
2 checks passed
@copyleftdev copyleftdev deleted the fix/timestamp-role-journal-example branch June 2, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant