Slim init preflight; redirect scan logs to file#29
Merged
Conversation
…ogs to file whygraph init now runs only the git preflight check — gh and LLM provider checks are deferred to scan time, after the developer has configured whygraph.toml. Showing optional warnings before any config exists was misleading noise. whygraph scan redirects all log output to .whygraph/scan.log for the duration of the Progress block. The RichHandler is temporarily removed so log lines no longer interleave with progress bars; it is restored once the crawlers finish. The scan log path is printed after the bars complete.
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
Removes the
ghand LLM credential checks fromwhygraph init's preflight — those tools are only meaningful at scan time, afterwhygraph.tomlis configured. Init now only checks forgit, giving new users a cleaner onboarding experience with no false-alarm warnings.Adds
scan_log_redirectcontext manager incore/logger.pythat suppressesRichHandleroutput and redirects all log lines to.whygraph/scan.logduring a scan run. This prevents log messages from interleaving with the Rich progress bar and corrupting the terminal display. The log path is printed at the end of each scan.Changes
preflight.py: dropped_check_ghand_check_llmprobes;run_preflightno longer takes aproject_rootargumentcore/logger.py: addedscan_log_redirect(log_path)context manager — strips console handlers, writes to file, restores everything on exitcli/commands/scan.py: wrappedProgressblock withscan_log_redirect; prints the scan log path on completioncli/commands/init.py: updated_run_preflightcall site to match the new signaturetests/test_preflight.py,tests/test_init_agents.py: updated tests to match the slimmed preflight surface