Enhance drift summaries and controls#116
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (13 files)
Reviewed by kimi-k2.6-20260420 · 185,590 tokens |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the architecture drift reporting pipeline to reduce noise and improve CI / machine-consumption workflows by adding configurable drift “detail modes”, compact output metadata, and clearer base/head identity reporting across providers.
Changes:
- Add drift controls for graph-edge verbosity (
full|summary|off) and public API reporting (all|removals|off), including CLI flags and library options. - Enrich drift output with
formatmetadata and summary counts (summary.byKind,summary.bySeverity), plus more actionable duplicate drift details. - Report logical base/head refs (and stable roots) for git/artifact comparisons, and update docs and regression tests accordingly.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/drift.test.ts | Adds unit tests for graph-edge summary/off, public API filtering defaults, duplicate key diffs, and compact summary metadata. |
| tests/drift-git-provider.test.ts | Asserts git provider drift reports stable root and logical base.ref / head.ref. |
| tests/drift-artifact.test.ts | Asserts artifact baseline drift reports stable root and artifact identity in base.ref / base.root. |
| tests/cli-regressions.test.ts | Adds CLI regression tests for --compact-json, --graph-edges, and --public-api. |
| tests/cli-command-modules.test.ts | Verifies drift help output includes the new CLI flags. |
| src/index.ts | Re-exports new drift public types from the root package entrypoint. |
| src/drift/types.ts | Extends public drift/snapshot types with format/mode/summary controls and report metadata. |
| src/drift/report.ts | Improves pretty-rendered subjects for duplicate and summarized graph-edge findings. |
| src/drift/index.ts | Re-exports new drift public types from the drift module entrypoint. |
| src/drift/git.ts | Adds logical ref/root normalization to drift reports and forwards new compare options. |
| src/drift/compare.ts | Implements public API filtering, graph-edge summary/off, duplicate key diffs, and report-level summaries. |
| src/cli/options.ts | Registers --graph-edges and --public-api as value-taking CLI options. |
| src/cli/help.ts | Updates drift help text for new modes and --compact-json. |
| src/cli/drift.ts | Adds parsing and forwarding of --graph-edges, --public-api, and --compact-json. |
| README.md | Updates drift examples and recommends bounded output flags for CI/review usage. |
| docs/superpowers/plans/2026-06-01-drift-enhancements.md | Adds an implementation plan/checklist documenting the intended drift enhancements. |
| docs/library-api.md | Documents new drift options and logical ref reporting for library consumers. |
| docs/cli.md | Documents new drift CLI flags and recommended usage patterns. |
| docs/agent-workflows.md | Updates agent workflow guidance to prefer compact/bounded drift outputs. |
| codegraph-skill/codegraph/SKILL.md | Updates skill guidance to include bounded drift flags and compact JSON usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
121
to
127
| if (pretty) { | ||
| for (const line of renderArchitectureDriftReport(report, { limit: maxFindings }).trimEnd().split("\n")) { | ||
| context.writeStdoutLine(line); | ||
| } | ||
| } else { | ||
| context.writeJSONLine(report); | ||
| } |
| } | ||
| if (!base && !baseArtifact) { | ||
| context.writeStderrLine("Usage: codegraph drift [roots...] --base <ref> [--head <ref>] [--json | --pretty]"); | ||
| context.writeStderrLine("Usage: codegraph drift [roots...] [--root <path>] (--base <ref> | --base-artifact <dir>) [--head <ref>] [--json | --pretty]"); |
Comment on lines
125
to
133
| export interface ArchitectureDriftReport { | ||
| schemaVersion: 1; | ||
| format: ArchitectureDriftFormat; | ||
| root: string; | ||
| base: ArchitectureSnapshotSummary; | ||
| head: ArchitectureSnapshotSummary; | ||
| findings: ArchitectureDriftFinding[]; | ||
| summary: ArchitectureDriftSummary; | ||
| policy: { |
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.
Summary
Verification