Skip to content

docs: gaze crap --baseline-root flag and absolute-path baseline reconciliation #415

Open

Description

@jflowers

What changed

gaze crap gained a --baseline-root <dir> flag and automatic reconciliation of historical absolute-path baselines (fixes unbound-force/gaze#330):

  • Auto-reconciliation: baselines saved by gaze v1.9.x and earlier record absolute file paths; current reports record module-relative paths. When the absolute paths sit under the current module directory (same checkout path as when the baseline was generated), gaze crap now rewrites them to module-relative form before the file:function comparison — automatically, no flags.
  • --baseline-root <old-module-root>: explicit migration affordance for relocated checkouts (different machine or directory). Deterministic full-prefix relativization; never basename or suffix matching.
  • Actionable incompatibility diagnostic: when baseline paths sit under neither the current module directory nor --baseline-root, the run fails before any comparison output with the unreconcilable count, an example path, and both remediations (the regenerate command and the --baseline-root re-run). This is fatal for both explicit (--baseline) and auto-detected baselines — previously such baselines produced a false gate failure reporting every function as both new and removed.
  • stderr observability: a one-line normalization notice when paths were rewritten (recommends regenerating), and a zero-match warning when a comparison matches zero functions while both sides are non-empty (likely causes: incorrect --baseline-root, baseline generated on another OS, entirely rewritten codebase). Neither appears on stdout, so --format=json output is unchanged.

Why it matters

Users upgrading from gaze v1.9.x with committed baselines currently get a false baseline-gate failure (exit 1) on unchanged code, with 100% of functions reported as new+removed and no guidance. The fix makes the historical format work transparently where it can and fail loudly with remediation steps where it cannot. This is a user-facing CLI behavior change worth documenting on the website.

Pages needing updates

  • CLI reference page for gaze crap — add the --baseline-root flag row and a "Baseline path compatibility" section (mirrors docs/reference/cli/crap.md in the gaze repo)
  • CI integration / baseline regression guide — add the migration table (same checkout path / relocated checkout / unknown or cross-OS root) mirroring docs/guides/ci-integration.md
  • Any page describing baseline creation/comparison that should mention historical absolute-path baselines are auto-reconciled

Repo-side docs updated in the same change: docs/reference/cli/crap.md, docs/guides/ci-integration.md, README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions