From 26e415f2fd4fc2f01fe640c6ac68d01d2d2c1fc0 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Wed, 1 Apr 2026 08:06:36 -0700 Subject: [PATCH] fix(checkpoint): make surface area stats best-effort with baseline cascade Replace rigid with-spec/bare-commit split with a 4-level fallback: baseline_commit, merge-base, HEAD~1, skip. Omit metrics that cannot be computed rather than failing. Co-Authored-By: Claude Opus 4.6 --- .../bmad-checkpoint-preview/step-01-orientation.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-01-orientation.md b/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-01-orientation.md index 5d1e5fcff..c9fa64264 100644 --- a/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-01-orientation.md +++ b/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-01-orientation.md @@ -63,10 +63,12 @@ Set `review_mode` — pick the first match: ### Surface Area Stats -Compute from `git diff --stat` against the appropriate baseline: +Best-effort stats from `git diff --stat`. Try these baselines in order: -- **With spec**: Use `baseline_commit` from frontmatter. If missing, diff `HEAD~1..HEAD` and tell the user stats reflect only the latest commit. -- **Bare commit**: Diff against parent (`commit~1..commit`). For merge commits, use `--first-parent`. +1. `baseline_commit` from the spec's frontmatter. +2. Branch merge-base against `main` (or the default branch). +3. `HEAD~1..HEAD` (latest commit only — tell the user). +4. If git is unavailable or all of the above fail, skip stats and note: "Could not compute stats." Display as: @@ -74,13 +76,13 @@ Display as: N files changed · M modules touched · ~L lines of logic · B boundary crossings · P new public interfaces ``` -- **Files changed**: from `git diff --stat` -- **Modules touched**: distinct top-level directories with changes +- **Files changed**: from `git diff --stat`. +- **Modules touched**: distinct top-level directories with changes. - **Lines of logic**: added/modified lines excluding blanks, imports, formatting. `~` because approximate. - **Boundary crossings**: changes spanning more than one top-level module. `0` if single module. - **New public interfaces**: new exports, endpoints, public methods. `0` if none. -If git is unavailable or a command fails, show what you can and note what's missing. +Omit any metric you cannot compute rather than guessing. ### Present