/expert auto: the irreversible brake is unenforced prose, and the run never reports back - #490
Open
CSalcedoDataBI wants to merge 1 commit into
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #440