Skip to content

Add core.version stamp, core-doctor health report, and audit --changed#9

Closed
Gerrrt wants to merge 3 commits into
mainfrom
claude/zen-lovelace-s0sg7i
Closed

Add core.version stamp, core-doctor health report, and audit --changed#9
Gerrrt wants to merge 3 commits into
mainfrom
claude/zen-lovelace-s0sg7i

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

What & why

This PR adds three major features to tighten the dev loop and improve visibility:

  1. core.version — a human-readable SemVer stamp vendored into every OS repo, plus a core-version verb that reads it. Lets you tell which Core a given OS repo carries from inside it (the subtree squash records the commit; this records the version). scripts/sync-core.sh prints it on fan-out and the audit asserts it is well-formed.

  2. core-doctor — the shell counterpart to nvim's :checkhealth gerrrt: a scannable report of which modern-CLI tools Core detected on this box and which integrations are live, including resolved binary names (fd/fdfind, bat/batcat) and the detected package manager. Read-only diagnostics.

  3. audit-core.sh --changed (make audit-changed) — scope the audit to what your local git diff touches, via the SAME scripts/ci-classify.sh CI uses. Fails safe to the full run when the diff can't be resolved, tightening the dev loop without sacrificing correctness.

Also fixes two silent breakages in fzf/fzf-tab previews and adds defensive error handling to fif/fbr/zoxide-jump so they degrade in Core's voice instead of raw "command not found" on bare boxes.

Is it actually Core?

  • Identical on every machine — not OS-specific
  • Not offensive/engagement tooling

Contract & checks

  • core.manifest updated to include core.version
  • make audit is green (new audit section for fzf preview binary resolution, core.version well-formedness check)
  • Exec-bits correct: scripts/audit-core.sh, scripts/sync-core.sh, scripts/setup.sh remain +x; zsh/*.zsh modules not executable
  • New completions added for core-version, core-doctor, fif, fbr; _up completion updated for --dry-run

Notes

  • Load order: core.version is a static file (no load-order impact); core-version and core-doctor are functions in zsh/functions.zsh (loaded early in the canonical chain).
  • Audit gates: New section 5b (fzf preview binary resolution) locks the preview binary resolution pattern so the Debian/Ubuntu batbatcat regression can't recur.
  • Fallback safety: --changed fails safe to the full run when git diff can't be resolved; fif/fbr/zoxide-jump degrade gracefully on bare boxes.
  • Sync implications: scripts/sync-core.sh now prints the core.version stamp alongside the commit SHA in the fan-out log.
  • Tests: Existing behavioral tests in scripts/test-core.sh cover core-version, core-doctor, fif/fbr error paths, and up --dry-run.

https://claude.ai/code/session_01TerNRHYmC9KyvcTswAqfuP

Fixed
- fzf/fzf-tab previews hardcoded bat/eza -> "command not found" preview panes
  on Debian/Ubuntu (batcat) and bare boxes; now resolve $BAT_BIN with cat/ls
  fallback. New audit section locks it against regression.
- fif/fbr/Alt-Z zoxide-jump now degrade in Core's voice (_core_err/_core_hint)
  like fcd, instead of a raw "command not found".

Added
- core.version stamp + core-version verb (which Core does an OS repo carry?);
  sync-core prints it, audit validates SemVer shape.
- core-doctor: shell-side health report (detected tools, resolved fd/bat names,
  package manager) — the counterpart to nvim :checkhealth.
- up -n/--dry-run: non-destructive "what would upgrade" inspect.
- make audit-changed (audit-core.sh --changed): scope the local audit to the
  git diff via the same ci-classify.sh CI uses.
- completions for fif/fbr/core-version/core-doctor + dry-run-aware _up; parity
  test extended to cover them.
- .shellcheckrc for author==CI==editor lint parity.

Changed
- setup.sh provisions luacheck via luarocks + precise install hints.

All changes gated: audit 133 pass / 1 skip / 0 fail; behavioral suite 68/0.
Copilot AI review requested due to automatic review settings June 14, 2026 21:12
The new '### Fixed' under [Unreleased] duplicated an existing (mis-indented)
'### Fixed', tripping markdownlint MD024/no-duplicate-heading on the CI audit
(ubuntu + macos). markdownlint is skipped locally (npm unavailable in the dev
sandbox) so it wasn't caught pre-push. Merged both into one de-indented section;
validated with markdownlint-cli2 v0.22.1 (0 errors).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds three complementary features to dotfiles-core: a vendored SemVer version stamp (core.version), a core-doctor shell health report, and a --changed flag for the audit that scopes runs to what the local git diff touches. It also fixes silent fzf/fzf-tab preview breakage on Debian/Ubuntu (where bat ships as batcat) and adds defensive error handling to fif/fbr/zoxide-jump widgets.

Changes:

  • Introduces core.version file, core-version and core-doctor functions, with associated completions, tests, manifest entry, and audit well-formedness check.
  • Adds --changed to audit-core.sh (and make audit-changed) which reuses ci-classify.sh to derive the audit scope from the working-tree diff, failing safe to a full run.
  • Fixes fzf previews to resolve $BAT_BIN/$HAVE_EZA dynamically with cat/ls fallbacks, and guards fif/fbr/zoxide-jump with _core_have checks for graceful degradation.

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
core.version New SemVer stamp file (0.1.0-dev)
core.manifest Adds core.version to the vendored manifest
zsh/functions.zsh core-version, core-doctor functions + core-help version display
zsh/fzf.zsh Dynamic $BAT_BIN/$HAVE_EZA preview resolution + guards on fif/fbr/zoxide-jump
zsh/plugins.zsh fzf-tab cd preview falls back to ls without eza
zsh/update.zsh up --dry-run implementation
zsh/completions/_up Mutual-exclusivity between -y and -n
zsh/completions/_fif New completion for fif (describes the argument)
zsh/completions/_fbr New completion for fbr (no-arg message)
zsh/completions/_core-version New completion for core-version (no-arg message)
zsh/completions/_core-doctor New completion for core-doctor (no-arg message)
scripts/audit-core.sh --changed flag, _changed_scope function, section 5b (fzf preview gate), core.version check
scripts/ci-classify.sh Adds core.version to the infra bucket
scripts/sync-core.sh Prints core.version in fan-out log
scripts/setup.sh luacheck provisioning via luarocks + hint() helper
scripts/test-core.sh Tests for core-version, core-doctor, up --dry-run, fif/fbr guards, completions
Makefile audit-changed target
README.md Documents core.version in the tree layout
CHANGELOG.md Records all new features and fixes
.shellcheckrc Repo-wide ShellCheck config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/audit-core.sh
Comment thread scripts/audit-core.sh Outdated
Comment thread scripts/ci-classify.sh Outdated
…c bucket

- audit-core.sh _changed_scope: if ci-classify.sh errors or emits no/garbage
  output, sh/nv aren't valid true/false -> now fall back to 'all' (full run)
  instead of silently returning 'none', honoring the documented fail-safe.
- audit-core.sh --help: usage synopsis now lists [--changed].
- ci-classify.sh: classify .shellcheckrc into the infra bucket (full run) so a
  change to it doesn't hit the catch-all 'unrecognised path' warning; locked
  with a test-core.sh assertion.
@Gerrrt Gerrrt closed this Jun 14, 2026
@Gerrrt
Gerrrt deleted the claude/zen-lovelace-s0sg7i branch June 14, 2026 21:57
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.

3 participants