Skip to content

Add independent precommit review - #293

Draft
vshvedov wants to merge 12 commits into
google:mainfrom
vshvedov:feat/precommit-review
Draft

vshvedov wants to merge 12 commits into
google:mainfrom
vshvedov:feat/precommit-review

Conversation

@vshvedov

@vshvedov vshvedov commented Nov 4, 2026 •

Copy link
Copy Markdown

Contribution Type

Track: Feature / Architectural Change -- Stage 2: Implementation PR

Draft implementation. Refs #295. The separate Stage 1 design is in #313. Waiting for maintainer scope alignment, a merged design and pr-ready.

Summary of Key Changes

Adds egm-precommit-review, adapting the workflow from my elephant-goldfish and ClaudeFlows implementations.

A fresh reviewer checks staged, unstaged and untracked changes without the implementation conversation. Findings stay in a ledger until fixed and rechecked or explicitly rebutted. Review-only is the default; optional fix mode runs a bounded review loop. The skill never stages or commits.

Includes a read-only Claude reviewer, an evidence protocol that keeps staged and working-copy versions separate, packaging, a separate design proposal, and tests.

Review follow-up: explicitly stop on Cursor, Copilot CLI and OpenCode until native reviewer adapters exist. Tighten three evaluation patterns with nine regression cases and list the skill on the website.

Latest review follow-up: reject backtick and bold no findings sentinels, with four regression cases. Match the website skill order to the README and correct the current Cursor/OpenCode skill counts. Historical verification notes are unchanged. The PR is now marked as a draft.

Exclude prior generated review artifacts from fresh review evidence while retaining tracked changes and similarly named untracked source. Both branches include the upstream Inventive Catalyst reviewer.

Each implementation branch currently contains nine skills, including EGM Lite. Reconcile shared inventory counts to ten when both implementations land, and include the help skill from #298 if it lands first.

The evidence protocol keeps raw Git captures parent-side, records a text inventory for the reviewer, and binds each check to its tested layer and the scope digest. The report has explicit outcome precedence.

Human Accountability Affirmation

  • I am a human contributor. I have personally reviewed, understood, and can explain every line of this change in review (using AI tools to write code is welcome, but human understanding of the submitted change is required).

Verification

  • Passed: python -m pytest tests/unit: 415 passed, 2 optional host probes skipped.
  • Passed: live Claude review and fix/recheck workflows, isolation and denied-read probes, and a focused Codex review (verified from retained native records after a status-parser fix). Fixtures verify a staged bug hidden by the working copy, an untracked bug, actual test execution, complete file reads and unchanged index/HEAD.
  • Passed: independent review, packaging, site tests (9), type checking, builds and browser checks (12).
  • Not run: formal /egm-review and /egm-resolve; not every behavioral scenario was exercised live. Codex's encrypted dispatch inputs remain unaudited.

Latest validation: full unit suite (two optional native-host probes skipped), site tests (9), Astro type checking and production build passed. The focused live Claude review kept a prior review marker out of the fresh reviewer input and trace, and retained the untracked source with a similar directory name.

Unit suite: 416 passed, 2 skipped. Live Claude review passed. The live fix run reached a clean outcome, and its retained evidence passed the corrected summary assertions. The saved scope digests matched the checks in both modes.

Updated against current main, including EGM Lite and Windsurf routing. Latest validation: 463 unit tests passed, two optional native-host probes skipped. Ruff, site tests (14), Astro type checking, production build and documentation checks passed. Live model workflows were not rerun for this integration update. The Unicode trace fixture now writes UTF-8 explicitly for Windows.

@google-cla

google-cla Bot commented Nov 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vshvedov
vshvedov marked this pull request as ready for review November 4, 2026 03:00
@vshvedov
vshvedov marked this pull request as draft November 4, 2026 03:03

@n3wth n3wth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 86122c1. A pre-commit review is a real gap in EGM, and keeping the Elephant on Git and the Goldfish on saved evidence is the right split. I agree on the three separate patches instead of git diff HEAD, on treating a failed command or a coverage gap as incomplete rather than empty, and on keeping clean, completed with rebuttals and no changes as different outcomes. The Claude adapter matches the other reviewers, and test_claude_reviewers_are_read_only_with_fresh_context now covers it. The packaged copy matches a fresh pack_plugin.py --target claude.

[P2] The track doesn't fit yet. It's the same as #292: the description picks Stage 2, which needs a pr-ready issue and a merged design, but there's no issue for this, and docs/designs/precommit_review.md arrives in this PR with its status still pending. AGENTS.md asks for a scope issue with design-ready first, then a Stage 1 PR with only the design and its index row, then this implementation. Splitting the design from its implementation is the process, not the artificial splitting AGENTS.md warns about. I'd open the issue, move precommit_review.md and the docs/designs/README.md row into a Stage 1 PR, and keep this one as a draft until that merges. The description already calls it a draft for feedback, so marking it as one here would match.

[P3] OpenCode gets the skill (the command count goes to 8), but the egm agent's task permission in adapters/opencode/install.py allows only the seven document reviewers, so there's no general-purpose agent to fall back on there. The skill would end incomplete every time. Inline, in both copies.

[P3] Three scenario patterns pass the reply they're meant to catch. Inline.

Outside the diff, so no suggestion: site/src/components/Skills.astro still lists seven skills. The README row is added, so the site should get the same entry.

I ran tests/unit locally at this head on Python 3.15: 398 passed, 2 skipped, same as the description, and the same with the suggestions applied. git diff --check is clean and this merges cleanly with main. cla/google fails, so the CLA needs signing before this can merge. check-changes passes; Evaluate PR Scope and Template has one failed and one passed run on this head. I didn't run the live Claude or Codex tests.

Comment thread skills/egm-precommit-review/SKILL.md Resolved
@vshvedov
vshvedov marked this pull request as ready for review November 4, 2026 22:01

@n3wth n3wth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 833b369. The follow-up covers everything from my last pass: the skill now stops on Cursor, Copilot CLI and OpenCode instead of trying a dispatch that's always denied, the three scenario patterns are tightened with the nine regression cases in test_precommit_scenarios.py, and the site has the skill entry. Moving precommit_review.md and its index row out and opening #295 is the right shape for the track.

[P2] Still on the track: the description picks Stage 2, but #295 has no labels yet and there's no merged design, so this can't merge until the Stage 1 PR lands and the issue gets pr-ready. The description says it stays a draft until then, but the PR isn't marked as one on GitHub. I'd convert it to a draft so the state matches.

[P3] The prompt_injection forbidden pattern misses the sentinel when it's formatted. Inline.

Outside the diff, so no suggestion: docs/opencode.md says the native configuration contains seven commands and that seven skills are discoverable. It's eight now, which test_opencode_adapter.py asserts. Smaller: the README puts Precommit review before Drift report and Skills.astro puts it after; either order works, but they should match.

Please retitle to type(scope): summary, for example feat(skills): add independent precommit review.

I ran tests/unit locally at this head on Python 3.15: 407 passed, 2 skipped, same as the description, and the same with the suggestion applied. The packaged copy matches a fresh pack_plugin.py --target claude. Site tests pass (9) and astro build completes. git diff --check is clean and this merges cleanly with main. cla/google passes now, and both Evaluate PR Scope and Template runs pass on this head. I didn't run the live Claude or Codex tests.

@n3wth n3wth mentioned this pull request Nov 4, 2026
1 task done
@vshvedov
vshvedov marked this pull request as draft November 5, 2026 15:35
@vshvedov vshvedov changed the title Add independent precommit code review feat(skills): add independent precommit review Nov 5, 2026
@vshvedov vshvedov mentioned this pull request Nov 5, 2026
1 task done
@n3wth n3wth added docs Improvements or additions to documentation harness Host adapters, installation, and compatibility isolation Reviewer context, permissions, and instruction leakage tests Changes to tests, fixtures, and validation labels Nov 6, 2026
@vshvedov
vshvedov requested a review from n3wth November 6, 2026 14:23
@n3wth n3wth changed the title feat(skills): add independent precommit review Add independent precommit review Nov 12, 2026
@vshvedov
vshvedov requested a review from n3wth November 12, 2026 14:46
@vshvedov
vshvedov marked this pull request as ready for review November 12, 2026 14:47

@n3wth n3wth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed af1b39f.

The design prerequisite is still open in #313, so this remains blocked on that design merging and implementation readiness. Please make the GitHub draft state match the description. One merge-order update to my earlier review: #298 also adds an eighth skill, alongside #292, so whichever branches land later must reconcile all shared inventory counts. This pass covers readiness and integration conflicts; it is not a fresh line-by-line review of the skill and test bodies.

@n3wth n3wth linked an issue Nov 18, 2026 that may be closed by this pull request
@vshvedov
vshvedov marked this pull request as draft November 20, 2026 03:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation harness Host adapters, installation, and compatibility isolation Reviewer context, permissions, and instruction leakage tests Changes to tests, fixtures, and validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add independent code review before commits

2 participants