Skip to content

feat(action): preview contracts, reviewers, and architecture drift - #695

Merged
aryamthecodebreaker merged 1 commit into
mainfrom
feat/action-contracts-reviewers-drift
Nov 23, 2026
Merged

aryamthecodebreaker merged 1 commit into
mainfrom
feat/action-contracts-reviewers-drift

Conversation

@aryamthecodebreaker

Copy link
Copy Markdown
Owner

Adds preview GitHub Action support for three features that already exist in Core, the CLI and MCP. Each input is off by default. The JSON report contract (FixMapReport and VerifyResult) does not change: new sections go into the readable report, the step summary and the PR comment, the same way the change-scope and capability sections from #687 do.

New inputs and output

Input Modes What it adds
contracts: true plan, verify A Contract changes (preview) section: breaking/unknown/compatible counts and the top 10 changes with paths, from compareContractRefs over the exact base and head commits without a checkout. Sets the breaking-contract-count output. A breaking change never fails the step. In verify mode only the existing findings and fail-on decide that.
reviewers: true plan A Suggested reviewers (preview) section from routeReviewers, covering the report's changed files (or its ranked context files when nothing changed). Output goes through reviewRoutingWithoutMentions, so no name is written with @. The Action never requests a review.
reviewers-history-authors: false plan Same as fixmap reviewers --no-history-authors. Requires reviewers: true.
architecture-drift: true plan An Architecture drift (preview) section from compareArchitectureRefs: added/removed edges, new and resolved cycles, new policy (boundary) violations and decision disagreements, each list capped at 10.

The base-vs-head sections run only on pull requests where both refs are known. If a ref is missing or can't be resolved (for example in a shallow checkout), the job doesn't fail: it prints a ::warning:: and a notice that suggests fetch-depth: 0. Contract reasons and reviewer diagnostics also pass through withoutMentions, so a GraphQL @deprecated in a contract can't notify anyone. reviewers and architecture-drift are rejected in verify mode, and all four inputs are rejected in annotate mode. The boolean defaults that GitHub always passes ("false", and "true" for reviewers-history-authors) are not counted as "used".

Evidence for the ledger rows (Action parity only)

  • Contract Guardian: contracts input in plan and verify modes. Tests run on a real temporary Git repo where removing an OpenAPI operation gives - Breaking: 1 and breaking-contract-count=1. They also check that HEAD stays on the feature branch with a clean git status, that verify mode passes with the breaking change, and that a missing base ref, or a run with no PR, degrades to a warning.
  • Ownership and review routing: reviewers and reviewers-history-authors inputs. Tests use a real repo with .github/CODEOWNERS (@org/everyone, @security-team). The summary shows `security-team` (high; CODEOWNERS) plus the commit author, and neither stdout nor the summary matches a mention pattern. The test client's requestReviewers is never called. With reviewers-history-authors: false the commit author is dropped.
  • Architecture drift: architecture-drift input. A test on a real repo whose feature branch adds an a ↔ b import cycle gives - Added edges: 2 and - New cycles: 1 (resolved: 0). Both sides are read from Git objects, and the worktree stays clean.
  • Shared: with every input absent (or left at its default), no scan or compare function runs and the outputs end at test-route-count. With a read-only token (403 Resource not accessible), the existing warning prints and the sections and breaking-contract-count are still present.

Held-out evidence and the other open items in these rows are not part of this PR.

Checks run locally

Per the process rules, only the fast checks ran: Action tsc --noEmit, eslint src test, vitest run (7 files, 75 tests pass), npm run build:action, npm run check:action-metadata and npm run check:action-bundle. GitHub CI is the full gate. The Git-fixture tests use { timeout: 30_000 }.

The ledger, CHANGELOG.md, versions and the website changelog are left for the release session.

🤖 Generated with Claude Code

Adds three preview Action inputs backed by the existing Core engines:

- contracts (plan and verify modes): exact-ref contract diff without
  checkout, a bounded "Contract changes" section, and the
  breaking-contract-count output. Breaking changes never fail the step.
- reviewers (+ reviewers-history-authors): a bounded "Suggested
  reviewers" section for the changed paths. Names print without "@" and
  no review is requested.
- architecture-drift: a bounded "Architecture drift" section from
  base/head Git objects (edges, cycles, policy violations, decision
  disagreements).

Missing refs degrade to a warning and a notice. The JSON report contract
is unchanged. Bundle rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fixmap Ready Ready Preview Nov 23, 2026 2:12pm UTC

@aryamthecodebreaker
aryamthecodebreaker merged commit 37686ee into main Nov 23, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — b5bd74e4 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant