Skip to content

feat(core): add a native core front door for cross-fleet command parity#98

Merged
Gerrrt merged 3 commits into
mainfrom
claude/unify-core-command
Jul 10, 2026
Merged

feat(core): add a native core front door for cross-fleet command parity#98
Gerrrt merged 3 commits into
mainfrom
claude/unify-core-command

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Why

On macOS/Linux the umbrella verb is core (core doctor / core help / core version / core update, plus core-* twins). Windows had no core command — you had to reach for dotfiles-doctor where the rest of the fleet uses core doctor. This closes that gap so the same command works on every machine.

What

New front door (powershell/os/48-core.ps1):

  • core dispatcher — help / doctor / version / update; bare core prints the command index; a typo gets a did-you-mean (via the module's Get-DotLevenshtein). Mirrors dotfiles-core's zsh core().
  • Standalone core-doctor / core-help / core-version twins (matching Core's core-* names).
  • These are thin routing over the host's existing verbs (dotfiles-doctor / dothelp / up), which stay canonical — the old names still work. core-version prints dotfiles-Windows <rev> (this layer has no core.version file, so the revision is the version).
  • Lives in os/ (after 45-doctor.ps1) on purpose: core doctor bridges to the host's dotfiles-doctor, so it must load after it for the # provides:/# requires: load contract to resolve.

Visual parity: core doctor (i.e. dotfiles-doctor) now renders Core's header grammardotfiles-Windows <rev> — core-doctor (✓ ok · ! warn · ✗ fail) with cyan section headers — instead of the inverse-chip banner, so the report reads the same on both shells. (Write-DotBanner dropped from the doctor's requires since it's no longer used there.)

Also: registered core in the dothelp catalog, documented it in aliases.md, and added tests/Core.Tests.ps1 (routing + arg pass-through + twins + the typo path).

Companion PR

The cross-shell name pinning lands in dotfiles-core (PARITY.md + scripts/parity-check.sh) so CI gates the two shells together and this can't drift — opened separately.

Verification note

I authored this without a local PowerShell runtime, so I leaned on the repo's own gates: the new fragment follows the # provides:/# requires: load contract (LoadContract will check it), Core.Tests.ps1 covers the dispatch, and PSScriptAnalyzer/Pester run in CI. The visual rendering (header line + cyan sections) couldn't be eyeballed here — worth a quick look on a real Windows box; it's two cosmetic edits in 45-doctor.ps1 and trivially tunable.

🤖 Generated with Claude Code


Generated by Claude Code

…rity

On the Unix side (dotfiles-core) the umbrella verb is `core` (core doctor /
help / version / update, plus core-* twins). Windows had no `core` command —
you had to remember `dotfiles-doctor` where macOS/Linux use `core doctor`.

Add a native pwsh `core` front door (os/48-core.ps1) that mirrors Core's
surface so the same command works fleet-wide:

- `core` dispatcher (help/doctor/version/update; bare `core` = the index;
  did-you-mean on a typo), + standalone core-doctor/core-help/core-version
  twins. Thin routing over the host's existing verbs (dotfiles-doctor /
  dothelp / up), which stay canonical — the old names still work.
- Loads from os/ (after 45-doctor) so the load contract resolves.

Visual parity: `core doctor` (dotfiles-doctor) now renders Core's header
grammar — `dotfiles-Windows <rev> — core-doctor (<glyph legend>)` with cyan
section headers — instead of the inverse-chip banner, so the report reads the
same on both shells.

Also: register `core` in the dothelp catalog, document it in aliases.md, and
add tests/Core.Tests.ps1 covering the dispatch + twins.

Note: the cross-shell name pinning in dotfiles-core (PARITY.md +
parity-check.sh) lands in a companion PR so CI gates the two shells together.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CpbBxJLgsg3T3ropqYGJA
Copilot AI review requested due to automatic review settings July 10, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a native core command surface to the Windows PowerShell dotfiles so operators can use the same umbrella verbs (core doctor/help/version/update) across macOS/Linux and Windows, with matching standalone core-* twins and aligned core doctor rendering.

Changes:

  • Introduces powershell/os/48-core.ps1 implementing core dispatch plus core-doctor/core-help/core-version thin pass-through twins.
  • Updates dotfiles-doctor header/section styling for cross-shell visual parity and adjusts its load-contract requires.
  • Registers/documentation/tests: adds Pester coverage for routing, adds core to the help catalog, and documents it in aliases.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Core.Tests.ps1 New Pester tests validating core dispatch, arg pass-through, typo suggestion behavior, and core-* twins.
powershell/os/48-core.ps1 New core front door dispatcher + core-* standalone twins, using existing host verbs.
powershell/os/45-doctor.ps1 Updates dotfiles-doctor header grammar and section colors; drops unused Write-DotBanner dependency.
powershell/Dotfiles/Help.Helpers.ps1 Registers core <verb> in the dothelp catalog.
aliases.md Documents the new core/core-* commands in the alias cheat sheet.

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

Comment on lines +269 to +273
$ver = 'dev'
if ($env:DOTFILES_WIN -and (Test-Cmd git)) {
$s = (& git -C $env:DOTFILES_WIN rev-parse --short HEAD 2>$null)
if ($s) { $ver = $s }
}
claude added 2 commits July 10, 2026 22:09
… the doctor

- tests/Core.Tests.ps1: the leaf stubs are `global:` functions, so a
  `$script:` recorder set in BeforeAll resolves to a different scope than the
  It blocks read — the 6 routing asserts saw an empty list and failed. Record
  into `$global:DotCoreCalls` so the stubs and asserts share one list.
- doctor header + core-version: resolve the repo root as `$global:DOTFILES`
  else `$env:DOTFILES_WIN` (the same order the doctor's Repo-root probe uses)
  and apply the `.git` guard, so the header/version can't show `dev` when the
  root is only known via $global:DOTFILES (Copilot review).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CpbBxJLgsg3T3ropqYGJA
Three CI fixes for the `core` front door:

- os/48-core.ps1: `$rest` splatted a STRING (`$args[1..N]` when N==1 is a
  scalar), so `core doctor -Quiet` exploded `-Quiet` char-by-char. Build the
  forward-args array with `@($args | Select-Object -Skip 1)` instead.
- tests/Core.Tests.ps1: Test-Cmd is a load-time fragment function, not a
  module export, so it was absent in the unit context and core-version threw
  CommandNotFound. Stub it in BeforeAll, clean up in AfterAll.
- README.md: add the new `48-core` fragment to the Layout box so the
  Repo.Tests golden check (box == on-disk fragments) holds.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CpbBxJLgsg3T3ropqYGJA
@Gerrrt Gerrrt merged commit ea3dd0d into main Jul 10, 2026
6 checks passed
@Gerrrt Gerrrt deleted the claude/unify-core-command branch July 10, 2026 22:35
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