Skip to content

feat: add forgebe review — AI-agnostic awareness report (Phase 1) - #1

Merged
farid-alfernass merged 12 commits into
mainfrom
feat/awareness-review
Jun 24, 2026
Merged

feat: add forgebe review — AI-agnostic awareness report (Phase 1)#1
farid-alfernass merged 12 commits into
mainfrom
feat/awareness-review

Conversation

@farid-alfernass

Copy link
Copy Markdown
Owner

Ringkasan

Menambahkan perintah baru forgebe reviewAwareness 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. Pakai git diff --no-renames agar parsing robust.
  • internal/review — rule engine: Reviewer.Run() menjalankan 6 rule yang memetakan langsung ke profile.Policy:
    • forbidden_path (FAIL), sensitive_area (WARN), dependency_added (FAIL/WARN), dependency_forbidden (FAIL), missing_test (WARN), summary (INFO).
    • Report me-render Text & JSON.
  • internal/cli/review.go — perintah cobra (--json, --staged, --since, --strict), terdaftar di root.go.
  • Dokumentasi — bagian forgebe review di docs/cli-reference.md + blok di README.md.
  • Dokumen desain & plandocs/superpowers/specs/ & docs/superpowers/plans/.

Postur

  • Default forgebe reviewinformational, exit 0 (tujuannya menyadarkan, bukan menghakimi).
  • --strictexit 1 bila ada FAIL (siap untuk pre-commit hook & GitHub Action di Fase 2).

Testing

  • TDD, table-driven. internal/git diuji dengan repo git sementara; rule diuji dengan FileChange sintetis.
  • 384 test pass di 17 package; coverage internal/git 86.4%, internal/review 90.6% (≥80%).
  • go vet bersih, gofmt -l kosong, binary build sukses.

Di luar lingkup (sengaja, Fase berikutnya)

  • Analisis import antar-layer arsitektur (Fase 3).
  • Provenance/chain-of-truth (dikesampingkan).
  • Pre-commit hook & GitHub Action (Fase 2 — Fase 1 sudah CI-ready: JSON + exit code).
  • Auto-fix (review hanya menyadarkan).

Catatan untuk Fase 2

Saat --strict jadi load-bearing di CI, pertimbangkan menyurfacekan error baca di manifestContains (saat ini best-effort) sebagai temuan INFO/WARN ketimbang diam.

🤖 Generated with Claude Code

farid-alfernass and others added 12 commits June 24, 2026 12:41
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>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@farid-alfernass
farid-alfernass merged commit 929d1fe into main Jun 24, 2026
2 of 3 checks passed
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