Drift Detection Guide

Understanding and acting on semantic drift in SEA-Forge.

What is Drift?

Semantic drift occurs when observed runtime behavior diverges from declared specifications. This can indicate:

Detection Methods

1. Activity-Based Drift

Compare declared activities vs observed activities:

1
just observe-diff my-context

Missing Activity: A declared activity never appears in logs Extra Activity: An undeclared activity appears in logs

2. Flow-Based Drift

Analyze sequence deviations:

3. Role-Based Drift

Actor participation analysis:

Interpreting Drift Reports

Severity Levels

Confidence Scores

Drift reports include confidence scores (0-1):

Responding to Drift

1. Investigate

Use the evidence pointers to locate source:

1
just observe-summary my-context

Review raw logs in the UI or exported artifacts.

2. Decide

Choose an action:

3. Act

Promote observed to declared with signed commit:

1
2
3
# In the UI, click "Promote to Declared"
# Or use CLI:
just observe-promote my-context --sign

Best Practices

  1. Baseline First: Establish drift baseline before changes
  2. Monitor Regularly: Set up automated drift scanning
  3. Context Matters: Consider business context when interpreting
  4. Gradual Adoption: Start with high-value processes

Example Workflow

1
2
3
4
5
6
7
8
9
10
11
12
13
# 1. Establish baseline
just observe-all payment-process logs/payment-baseline.csv
just observe-summary payment-process

# 2. Monitor after deployment
just observe-all payment-process logs/payment-after.csv
just observe-diff payment-process

# 3. Investigate new drifts
cat artifacts/observe/payment-process/drift_diffs.json | jq .

# 4. Act on findings
# (Use UI or promote observed changes)