Draft
Refactor logger persistence wrappers and document env expansion semantics#10086
Conversation
6 tasks
Copilot
AI
changed the title
[WIP] Refactor semantic function clustering analysis based on report
Refactor logger persistence wrappers and document env expansion semantics
Jul 25, 2026
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.
Semantic clustering flagged low-effort cleanup opportunities: thin persistence wrappers in logger internals and potential confusion between two env-expansion paths with different failure semantics. This PR applies those targeted refactors without changing behavior.
Logger internals: remove thin
writeToFileindirectioninternal/logger/tools_logger.go, inlinedwriteToFile()intoLogToolsby callingwriteJSON(tl.data, 0644)directly.internal/logger/observed_url_domains_logger.go, removedwriteToFile()and inlined serialization +writeJSON(..., 0600)at write sites (init + changed-domain flush path).Env expansion docs: clarify intentional semantic split
internal/envutil/expand_env_args.go, added a cross-reference note tointernal/config/expand.goclarifying:envutilexpansion passes through missing env vars unchangedconfigexpansion fails on undefined${VAR}Test alignment with refactor
internal/logger/tools_logger_test.goto validate the same file-write success/error paths throughwriteJSON(...)directly after removingwriteToFile().