mcpField
H
harness-drift-from-history

harness-drift-from-history

github.com/ruvnetTesting & quality80.0k236 installsUpdated today
Repository

About harness-drift-from-history

A Ruflo skill that compares audit history with a fresh oia-audit and returns a structured drift report, with alerts based on a similarity threshold. It is intended for recurring checks of audit changes.

Key features

  1. 01Selects the latest audit as baseline
  2. 02Runs and compares a fresh oia-audit
  3. 03Supports baseline age and thresholds
  4. 04Returns a structured drift report
  5. 05Distinguishes drift, config, and degraded states

Use cases

  1. 01Check periodically for changes in audit results
  2. 02Gate CI on a similarity threshold

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ruvnet/ruflo --skill harness-drift-from-history

After installing, type/harness-drift-from-historyin Claude Code to confirm it loaded.

Details

From the project README

The natural ops question after running oia-audit weekly is "did anything drift?" Before this skill, the answer required a three-step sequence:

npx ruflo metaharness audit-list --format json   # → pick a key by hand
npx ruflo metaharness oia-audit --format json > /tmp/curr.json
npx ruflo metaharness audit-trend \
  --baseline-key <picked-key> --current /tmp/curr.json \
  --alert-on-distance-below 0.95

This skill collapses it into one command:

npx ruflo metaharness drift-from-history --threshold 0.95

What it does

  1. Lists records from metaharness-audit namespace via audit-list.mjs
  2. Picks the most recent record by startedAt (or --baseline-since 7d skips anything newer than 7 days)
  3. Runs a fresh oia-audit against the current path
  4. Diffs the two via audit-trend, applying --alert-on-distance-below ${threshold}
  5. Returns the structured drift report

Architectural constraint inheritance (ADR-150)

ConstraintHow drift-from-history satisfies it
RemovablePure subprocess composition over existing scripts — no new @metaharness/* import
OptionalIf oia-audit reports degraded:true, this skill exits 3 with a degraded payload
GracefulEmpty audit history → exit 2 with hint to seed it; never crashes
CI-gateSmoke step 17z16 anchors the dispatcher entry + subcommand listing

Exit codes

  • 0 — similarity ≥ threshold (or threshold not crossed)
  • 1 — drift detected: similarity < threshold (alert fired)
  • 2 — config error (no history, audit-list failed)
  • 3 — upstream metaharness absent (degraded payload returned)

Example

$ npx ruflo metaharness drift-from-history --threshold 0.95
# drift-from-history

Baseline:        audit-2026-06-16T22-58-47-840Z
Current:         2026-06-16T23:05:02.231Z

Structural similarity: 1 (near-identical)
Distance:              0

✓ similarity ≥ 0.95 — OK

Implementation

scripts/drift-from-history.mjs

Comments

Markdown supported