Murali Gour

We built a diff analyzer that scores whether a code change matched the stated goal

by

One of the core tools in Invariant is diff_analyzer.

You give it:

- The code before the change

- The code after

- The goal you stated

It returns an alignment score with structured reasoning, not vibes, actual deterministic analysis using a Prolog-based engine underneath.

The idea was to make goal alignment a checkable property, not something you eyeball in PR review.

We also wired it into an agent feedback loop, two lines in a system prompt and the agent calls diff_analyzer automatically after making changes. If the score is below threshold, it revises before presenting its work.

Launched today. Would love feedback from anyone running agentic coding workflows.

3 views

Add a comment

Replies

Be the first to comment