Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Drift Scoring

notarai score computes a numeric drift score for each spec so you can prioritize reconciliation work. Scores are deterministic, produced without LLM calls, and always informational (exit code 0).

Score range and status

Each spec gets a score in [0.0, 1.0]:

RangeStatusMeaning
0.0 - 0.3healthySpec is aligned with code and docs.
0.3 - 0.6reviewSome drift signals; review soon.
0.6 - 1.0overdueHigh drift; reconcile now.

The overall score is the mean across all specs.

Signals

Six weighted signals contribute to each spec’s score. All weights are configurable via .notarai/scoring.yaml; defaults are shown below.

SignalDefault weightWhat it measures
files_changed0.30Governed files changed since last reconciliation.
days_since_reconciliation0.20Days since the reconciliation state was updated.
unresolved_decisions0.15Proposed (not yet accepted) decisions for spec.
orphaned_globs0.15Artifact glob patterns that match zero files.
open_questions0.10open_questions entries in the spec YAML.
unspecced_files0.10Tracked files in governed directories not covered.

Each signal is normalized to [0.0, 1.0] before being multiplied by its weight. The final score is clamped to 1.0.

Usage

notarai score
notarai score --format json
notarai score --spec .notarai/cli.spec.yaml

Human output

Spec                                          Score   Status
-----------------------------------------------------------------
.notarai/cli.spec.yaml                        0.42    review
.notarai/system.spec.yaml                     0.18    healthy

Overall: 0.30 (review)

JSON output

{
  "specs": [
    {
      "spec_path": ".notarai/cli.spec.yaml",
      "score": 0.42,
      "status": "review"
    },
    {
      "spec_path": ".notarai/system.spec.yaml",
      "score": 0.18,
      "status": "healthy"
    }
  ],
  "overall": { "score": 0.3, "status": "review" }
}

Configuration

Create .notarai/scoring.yaml to override default weights:

files_changed: 0.4
days_since_reconciliation: 0.1
unresolved_decisions: 0.2
orphaned_globs: 0.1
open_questions: 0.1
unspecced_files: 0.1

Weights do not need to sum to 1.0, but keeping them normalized makes the resulting score easier to interpret.

MCP integration

The initialize response from notarai mcp includes:

  • driftScore – overall score (0.0-1.0)
  • driftStatushealthy / review / overdue
  • mostDrifted – spec path with the highest score

This lets agents quickly orient without running a separate command.