feat(diff): semantic diff between agent versions - #98
Open
code-saksham-hash wants to merge 1 commit into
Open
Conversation
Adds `opengap diff [from] [to]`, comparing two agent snapshots (git refs materialized via `git archive`, or plain directories) and reporting structured changes instead of a raw text diff: agent.yaml fields, SOUL.md/RULES.md/DUTIES.md size deltas, skills/tools/workflows added-removed-modified, compliance changes (with a tier-escalation warning), hooks (flagging newly-enforced fail_open: false entries), and which memory/ files changed. Supports --json for CI/tooling use. Closes open-gitagent#4.
code-saksham-hash
force-pushed
the
feat/4-semantic-diff
branch
from
August 16, 2026 15:17
ea9ac49 to
5be52e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
opengap diff [from] [to], closing #4.Compares two agent snapshots — git refs (resolved via
git archive) or plain directories — and reports what actually changed instead of a raw text diff:agent.yamlfields, SOUL.md/RULES.md/DUTIES.md size deltas, skills/tools/workflows added/removed/modified, compliance changes (flags risk tier escalation), hooks (flags a newly-addedfail_open: falseentry), and which files undermemory/changed.--jsonfor scripting/CI.A few notes on how it's built:
git rev-parse+git archive— no working-tree checkout, so no lock conflicts, and it still works when--dirisn't a git repo at all (both-directories case).A..Bargument works too, split on the literal...opengap diffwith no args compares HEAD against the working directory, same idea as plaingit diff.agent.yamlandcomplianceare diffed generically (flatten + compare) instead of hand-listing every field, so new schema fields get picked up without touching this code.Tested with
npm run build+npm test(75/75, 24 new tests inagent-diff.test.tsandgit-ref.test.ts), plus manual runs againstexamples/standardvsexamples/fulland a throwaway two-commit repo — ref diffing,A..Bsyntax, barediff, an invalid ref, and confirming temp dirs actually get cleaned up.Sample output (`opengap diff ./examples/standard ./examples/full`)
Known gaps: nothing tests the Commander wiring directly (same as the other files in
src/commands/, the logic underneath is what's covered), and array-valued compliance fields likeescalation_triggers/handoffsare diffed as whole values rather than per-item add/remove. Can break those out further if you want it more granular.