feat: add forgebe review — AI-agnostic awareness report (Phase 1) - #1
Merged
Conversation
Design for `forgebe review`: a git-diff-based, AI-agnostic awareness command that surfaces what changed vs the project policy. Informational by default, gate via --strict. First sub-project of the "Aware-by-default, easy-to-adopt" roadmap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task-by-task plan for `forgebe review`: internal/git diff extraction, internal/review rule engine (6 rules), CLI command, AI-agnostic guard. Stdlib only, TDD, frequent commits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add ChangedFiles and IsRepo functions to extract and analyze git diffs. The package is deliberately AI-agnostic, inspecting only the diff result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ests - countLines now counts final lines lacking trailing newlines - OldPath field documented as reserved for future rename support - var order []string idiom instead of empty slice literal - git init suppresses default branch hint via init.defaultBranch=main - Added TestChangedFiles_Since and TestChangedFiles_DeletedFile tests Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implement internal/review package with Reviewer type, Finding struct, and two path-based rules (forbidden_path and sensitive_area) to evaluate file changes against project policies. Package is AI-agnostic and focuses on pure-path matching via glob patterns and substring searches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implements the missing_test rule to flag source file changes that lack corresponding test changes in the same commit. Includes three new helpers (isSourceFile, isTestFile, underAnyRoot, testKey) and one new rule (ruleMissingTest) wired into Run(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implement the summary rule to track file change statistics by directory, and introduce Report, Summary, and text/JSON rendering for awareness findings. Maintains AI-agnostic package design. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
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.




Ringkasan
Menambahkan perintah baru
forgebe review— Awareness Review: membandingkan git diff (output AI) terhadap policy project dan menampilkan laporan kesadaran ("apa yang berubah & apa yang perlu kamu sadari betul"). Ini Fase 1 dari roadmap Aware-by-default, easy-to-adopt.Prinsip inti: AI-agnostic. Karena bekerja pada git diff (hasil perubahan, bukan agennya), review berlaku untuk tool AI apa pun — Claude, Cursor, Copilot, Hermes, atau ketikan tangan. Sebuah guard test menjamin tidak ada referensi vendor AI yang bocor ke package
internal/review/internal/git.Yang ditambahkan
internal/git— ekstraksi diff:ChangedFiles(working tree termasuk untracked,--staged,--since <ref>),IsRepo. Pakaigit diff --no-renamesagar parsing robust.internal/review— rule engine:Reviewer.Run()menjalankan 6 rule yang memetakan langsung keprofile.Policy:forbidden_path(FAIL),sensitive_area(WARN),dependency_added(FAIL/WARN),dependency_forbidden(FAIL),missing_test(WARN),summary(INFO).Reportme-render Text & JSON.internal/cli/review.go— perintah cobra (--json,--staged,--since,--strict), terdaftar diroot.go.forgebe reviewdidocs/cli-reference.md+ blok diREADME.md.docs/superpowers/specs/&docs/superpowers/plans/.Postur
forgebe review→ informational, exit 0 (tujuannya menyadarkan, bukan menghakimi).--strict→ exit 1 bila ada FAIL (siap untuk pre-commit hook & GitHub Action di Fase 2).Testing
internal/gitdiuji dengan repo git sementara; rule diuji denganFileChangesintetis.internal/git86.4%,internal/review90.6% (≥80%).go vetbersih,gofmt -lkosong, binary build sukses.Di luar lingkup (sengaja, Fase berikutnya)
Catatan untuk Fase 2
Saat
--strictjadi load-bearing di CI, pertimbangkan menyurfacekan error baca dimanifestContains(saat ini best-effort) sebagai temuan INFO/WARN ketimbang diam.🤖 Generated with Claude Code