Refactor/engine redesign#21
Merged
Merged
Conversation
Adds SetLogLevel|DisableLogs|EnableLogs with a switchHandler gate
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.
Refactor of the engine/process internals behind the existing config API, plus bug fixes,
runtime logging controls, consolidated examples, and test coverage (engine+process now
~91%).
Bug fixes
StringtoConfigTOMLparsed TOML with the YAML decoder — now usestoml.Decode.IgnoreGitwas a no-op:.gitignorepatterns were read into a map nothing consulted. Nowactually applied in
shouldIgnore.slog.Errorcalls passed a bare error as a key, failinggo vetand blockinggo test.NewEngineFromConfiginstalled no logger; TOML/YAML constructors mutated a throwawayconfig copy and discarded
Slog.[""]ignore lists; an unknown config extension left anil engine → panic.
BackgroundStructwas never run — only itsDelayNextwas read.os.Exit(1)from library code.Refactor
os.Chdir-based process running with per-commandcmd.Dir, removing theglobal-cwd race with the watcher.
Start/Reload/Shutdownwith per-process contexts.Removed the
Ctxs/Cancelsside maps and the deadctx.Done()calls.setProcessGroup/killProcessTree/shellInvocationshim.sh -c/cmd /C), so quotes/pipes/&&work.ignoreMapmachinery.Behavior changes
BackgroundStruct.Cmdnow runs as a long-lived background process: started once, survivesreloads, killed at shutdown.
ExecList(CLI-e) now actually produces processes;REFRESH_EXECmarks the primary.New
SetLogLevel/DisableLogs/EnableLogs, plusSetLoggerwrapping acustom logger.
Execute,ExecuteType, type constants, and theKILL_STALE/REFRESH_EXECmarkers from the
enginepackage.Removed
tui/package and the rootmain.go(entrypoint iscmd/refresh); dropped thecharmbracelet deps.
NewEngine,AttachBackgroundCallback, and the unusedBackgroundCallbackfield.
example/module; consolidated intoexamples/basicandexamples/kitchen-sink.Tests
examples/kitchen-sinkdoubles as the end-to-end integration test: all execute types,ChangeDir, callback veto, ignore rules, BackgroundStruct, clean shutdown.
execution, failure paths, and CLI flag mapping.
go vet+go test -race ./...on Go 1.25; bumped EOL action versions.Notes
cmd.Dirchange and the supervisor rewrite are the highest-risk parts; verified with-raceand a live reload smoke test (no leaked processes).Windows.