Skip to main content

intent-drift

PyPI version Python versions License

Dependency-free Python library that detects intent drift in AI-assisted development: it compares the original goal against the current plan and execution activity, and returns an explainable alignment report.

🌐 Website: intent-drift.vercel.app - features, real report gallery, quickstarts, and changelog.

Install

pip install intent-drift   # Python >= 3.10

Quick Start

from intent_alignment import IntentAlignmentEngine

engine = IntentAlignmentEngine()

context = {
    "original_goal": {
        "text": "Reduce the application's memory usage.",
        "constraints": ["Stay under 100MB RAM"],
        "success_criteria": ["Peak memory < 50MB"],
    },
    "current_plan": {
        "summary": "Optimizing startup initialization for faster load.",
        "steps": ["Profile initialization", "Optimize startup sequence"],
    },
    "execution_context": {
        "edited_files": ["startup.py"],
        "git_diff": "+ def optimize_startup(): ...",
        "recent_messages": ["Working on startup optimization"],
        "reasoning_summary": "Focusing on startup performance",
    },
}

report = engine.evaluate(context)
print(report.overall_alignment)  # 0-100
print(report.status)             # e.g. "Moderate_Drift"
print(report.confidence)         # 0-100
print(report.recommendation)

evaluate() accepts a plain dict or an AlignmentContext dataclass. Use intent_alignment.report.render_report(report) to render the full text report (evidence, risk, and per-provider breakdown).

How It Works

The engine runs the context through pluggable evidence providers - goal alignment, constraints, scope, architecture, execution, file graph, dependencies, requirement coverage, and problematic findings. Each emits weighted evidence that is aggregated into an overall alignment score, confidence, status, and recommendation. No external NLP dependencies: matching is transparent token/alias-based, so every score is traceable to specific input text.

Extending

Implement EvidenceProvider (collect(context) -> list[Evidence]) and register it with engine.add_provider(provider).

Layout

src/intent_alignment/
├── engine.py     # IntentAlignmentEngine, provider registration
├── models.py     # AlignmentContext, AlignmentReport, Evidence, ScoreComponent
├── scoring.py    # Weighted aggregation of provider evidence
├── report.py     # render_report() -> human-readable text
├── utils.py      # Status, confidence, summary, risk, recommendation
└── evidence/     # EvidenceProvider base + 9 providers + shared analysis helpers
tests/            # Unit and integration test suite
examples/         # example_usage.py

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/

See CHANGELOG.md for releases. License: MIT.

Metadata

Release files for intent-drift 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intent-drift 0.1.3
File Size Uploaded Provenance Actions
intent_drift-0.1.3.tar.gz 22.7 kB With provenance Details for intent_drift-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for intent-drift 0.1.3
File Interpreter ABI Platform Actions
intent_drift-0.1.3-py3-none-any.whl Python 3 none any Details for intent_drift-0.1.3-py3-none-any.whl

Total release size: 52.3 kB

Release files / intent_drift-0.1.3.tar.gz

Download URL intent_drift-0.1.3.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c2fda30a8fb889b68c8e9a24816b12c8ddf1a8818c26f9c94396e306dd68f4
BLAKE2b-256 checksum
How to use checksums
a38894e3c630f368d590e33f1e9794049c923f10e2f7ef6f2fce9dbb940ba9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / intent_drift-0.1.3-py3-none-any.whl

Download URL intent_drift-0.1.3-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81c2f0615bb9dcd5fad3eca58e717c5d3edae7ad0e95966dd6509f65dee05b89
BLAKE2b-256 checksum
How to use checksums
611e804d8e67e8381effc738a3aa803d51669dc4742a590ab02b4714cd1a752d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for intent-drift 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for intent_drift-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page