Skip to content

fix: distinguish source checkout from home runtime - #77

Merged
hindermath merged 5 commits into
mainfrom
codex/fix-source-resolver-home-copy
Jul 19, 2026
Merged

fix: distinguish source checkout from home runtime#77
hindermath merged 5 commits into
mainfrom
codex/fix-source-resolver-home-copy

Conversation

@hindermath

Copy link
Copy Markdown
Owner

Zusammenfassung / Summary

  • validates a Level-0 source candidate by its expected origin, not directory shape alone
  • prevents copied scripts under ~/scripts/ from selecting the local Home runtime Git repository
  • preserves canonical, environment/state, and legacy resolution paths

Validation

  • Bash resolution from repository and Home script paths
  • PowerShell resolution from repository and Home script paths
  • Bash parser
  • PSScriptAnalyzer 1.25.0
  • statistics renderer

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

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 via git 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.md Profile 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.

Comment thread scripts/lib/resolve-home-baseline-source.sh Outdated
Comment thread scripts/lib/resolve-home-baseline-source.ps1 Outdated
Copilot AI review requested due to automatic review settings July 19, 2026 18:58

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

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 (where origin is 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-HBSourceRepository currently validates origin with a hard-coded hindermath/home-baseline suffix. That will reject legitimate checkouts created from the template (where origin is usually <user>/home-baseline) and will cause Resolve-HBSourceRepository to 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)?$'
}

Comment thread scripts/migrate-level0-source-checkout.sh Outdated
Copilot AI review requested due to automatic review settings July 19, 2026 19:27

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@hindermath
hindermath merged commit d9c903a into main Jul 19, 2026
21 checks passed
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.

2 participants