fix: distinguish source checkout from home runtime - #77
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens Level-0 source checkout resolution so copied scripts under ~/scripts/ don’t accidentally treat the Home runtime repository (~/) as the canonical home-baseline-source checkout, by validating candidates via their Git remote instead of directory shape alone.
Changes:
- Add helper predicates (
_is_hb_source_repository/Test-HBSourceRepository) that verify a candidate checkout viagit remote get-url origin. - Update both Bash and PowerShell resolvers to use the new predicates for all candidate paths (repo ancestry,
HOME_BASELINE_SOURCE, state file, default paths, legacy path). - Refresh
docs/project-statistics.mdProfile 2 numbers to reflect the change set.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/lib/resolve-home-baseline-source.sh | Adds _is_hb_source_repository and routes all resolution candidates through the remote-based validation. |
| scripts/lib/resolve-home-baseline-source.ps1 | Adds Test-HBSourceRepository and uses it for candidate validation in Resolve-HBSourceRepository. |
| docs/project-statistics.md | Updates the rendered statistics block (Profile 2) for the repository state at this commit. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
scripts/lib/resolve-home-baseline-source.sh:8
- The resolver now hard-codes the expected origin remote to
hindermath/home-baseline, which will fail for valid Level-0 checkouts created from the template (whereoriginis typically<user>/home-baseline). This makes source resolution break for non-hindermath users and could reintroduce selecting the wrong fallback path.
remote="$(git -C "$candidate" remote get-url origin 2>/dev/null)" || return 1
[[ "$remote" =~ hindermath/home-baseline(\.git)?$ ]]
scripts/lib/resolve-home-baseline-source.ps1:15
Test-HBSourceRepositorycurrently validatesoriginwith a hard-codedhindermath/home-baselinesuffix. That will reject legitimate checkouts created from the template (whereoriginis usually<user>/home-baseline) and will causeResolve-HBSourceRepositoryto throw even though the checkout is correct.
$remote = & git -C $Path remote get-url origin 2>$null
$LASTEXITCODE -eq 0 -and
[string]$remote -match 'hindermath/home-baseline(?:\.git)?$'
}
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.
Zusammenfassung / Summary
origin, not directory shape alone~/scripts/from selecting the local Home runtime Git repositoryValidation