Skip to content

/expert auto: the irreversible brake is unenforced prose, and the run never reports back - #490

Open
CSalcedoDataBI wants to merge 1 commit into
mainfrom
issue-440-expert-auto-the-irreversible-brake-is
Open

/expert auto: the irreversible brake is unenforced prose, and the run never reports back#490
CSalcedoDataBI wants to merge 1 commit into
mainfrom
issue-440-expert-auto-the-irreversible-brake-is

Conversation

@CSalcedoDataBI

Copy link
Copy Markdown
Owner

Closes #440

…440)

Three gaps remained after PR #468 armed the irreversible brake:

1. No post-run compliance report (problem 2).  The brief now embeds the
   default-branch SHA at launch time and instructs the session to compare
   the current SHA against it before recording Fleet-Findings, writing a
   PASS / VIOLATION verdict as an [abios-evidence] comment so the human
   learns immediately.  New pure functions: Assert-BrakeCompliance (detects
   whether main moved and whether that constitutes a violation given the
   contract) and Format-ComplianceReport (formats the verdict as a
   structured evidence block).

2. Token scope footgun (problem 3a).  Expert-Auto.ps1 overwrote GH_TOKEN
   with the registry PAT even when the ambient gh login was better-scoped,
   causing INSUFFICIENT_SCOPES on every board op inside the run.  New pure
   function Test-GhScope (injectable StatusText for unit tests) checks the
   ambient login first; the registry PAT is used only as a fallback when
   the ambient login lacks 'project' scope; if neither has it, a warning
   with a recovery command (gh auth refresh -s project) is emitted.

3. Stale HEAD footgun (problem 3b).  git fetch origin runs explicitly at
   launch time, the local default-branch SHA is compared to the remote, and
   a targeted warning tells the human their local view is stale.  The
   worktree base (origin/<default>) is unaffected — this is informational.

Format-AutoBrief gains three optional params (MainShaAtLaunch, Repo,
IssueNum) that expand to the compliance-checkpoint section; the existing
tests and call-sites are unaffected.

Tests: 24 new cases; Expert-Auto.Tests.ps1 28/28 green (was 4/4).

Co-Authored-By: CSalcedoDataBI <support@pesanteanalytics.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

/expert auto: the irreversible brake is unenforced prose, and the run never reports back

1 participant