#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename qw(basename);
use File::Spec;
use FindBin qw($Bin);

my $command = basename($0);
my $core = File::Spec->catfile( $Bin, '_dashboard-core' );
exec { $^X } $^X, $core, $command, @ARGV;
die "Unable to exec $core for $command: $!";

__END__

=pod

=head1 NAME

doctor - private built-in command wrapper for Developer Dashboard

=head1 SYNOPSIS

  dashboard doctor [--fix]

=head1 DESCRIPTION

This private helper is staged under F<~/.developer-dashboard/cli/dd/> so the
public C<dashboard> entrypoint can stay a thin switchboard.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes C<dashboard doctor> and C<dashboard doctor --fix>. It is the CLI front end for runtime permission audits and repairs.

=head1 WHY IT EXISTS

It exists because runtime permission repair is a built-in operational command, but the actual audit and repair policy belongs in the doctor module rather than in the public switchboard.

=head1 WHEN TO USE

Use this file when changing doctor CLI flags or the handoff from the staged helper into the runtime permission audit code.

=head1 HOW TO USE

Users run C<dashboard doctor> to inspect or C<dashboard doctor --fix> to repair. The staged helper passes the request into the private runtime, which loads the doctor service and prints its report.

=head1 WHAT USES IT

It is used by operators hardening runtime permissions, by security smoke tests, and by integration flows that validate owner-only runtime modes.

=head1 EXAMPLES

Example 1:

  dashboard doctor

Run the public built-in command path that stages or re-enters this helper.

Example 2:

  ~/.developer-dashboard/cli/dd/doctor --help

Inspect the staged helper directly after C<dashboard init> or helper extraction has populated the home runtime.

Example 3:

  prove -lv t/05-cli-smoke.t t/30-dashboard-loader.t

Rerun the focused staged-helper and thin-loader tests after changing helper dispatch behavior.

Example 4:

  prove -lr t

Verify that the helper still behaves correctly inside the complete repository suite.


=for comment FULL-POD-DOC END

=cut
