Conversation
Adds IHP.IDE.SourceInfo module that detects whether IHP is running from the nix store or a local checkout, and logs the path, git branch, and commit at startup so developers can quickly identify their IHP source. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Check if IHP_LIB path starts with /nix/store/ to correctly detect nix store vs local checkout (IHP_LIB is set in both scenarios) - Move source info log above version log and gate both behind isDebugMode - Use List.isPrefixOf for String comparisons to avoid type mismatches Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
IHP_LIB in nix store is a flat path like /nix/store/abc123-ihp-env-var-backwards-compat, not a nested ihp-ide/lib/IHP structure. Only navigate up 3 dirs for local checkouts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parse the project's flake.lock to extract the ihp input's branch (original.ref) and revision (locked.rev), so nix store builds show useful info like: IHP Source: Nix store (...) on branch main at revision abc123 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
- Rename `path` field to `checkoutPath` to avoid shadowing - Fix stderr handle leak: use NoStream instead of CreatePipe - Extract `parseFlakeLockJson` as pure function with dedicated tests - Extract `makeSourceInfo` and `isNixStorePath` to reduce duplication - Use `where` clauses instead of `let..in` - Use Aeson.object/.= in tests instead of escaped JSON strings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Unify getSourceInfo/makeSourceInfo: resolve dir first, then call makeSourceInfo once - Extract tryAnyNothing to deduplicate error handling in getFlakeLockInfo and getGitInfo - Move SourceInfoSpec after MigrationGenerator in Test/Main.hs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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.

Summary
IHP.IDE.SourceInfomodule that detects whether IHP runs from the nix store or a local checkoutLog.info(always visible, not gated behindDEBUG=1)IHP Source: Local checkout (/home/user/IHP) on branch feature-x at commit abc1234Test plan
formatSourceInfocovering all variants (NixStore, LocalCheckout with/without git info)devenv upwith a local IHP checkout and verify the log line appears🤖 Generated with Claude Code