feat(go): config + supervise SDK - #6
Merged
Merged
Conversation
Provide github.com/dcc-bigfred/microinit/go/client so bigfred and bigfred-os-ui can share one length-prefixed JSON Unix socket client. Co-authored-by: Cursor <[email protected]>
Expose ServiceDef/drop-in helpers and a process-only Host (EnsureRunning/Shutdown). Document the Go SDK under docs/sdk and docs/developer.md. Product policies (owned services) stay in callers. Co-authored-by: Cursor <[email protected]>
Add config/IPC labels, list --show-labels and -l key=value (AND), describe Labels section, and Go WithCreatedBy/MatchLabels for SDK v0.3.0. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
- readFrame: stream-decode via LimitReader+json.Decoder instead of pre-allocating the full declared frame (DoS on a 16MiB header). - Response: add stable `code` field; map on it in responseError instead of substring-matching the human message (not_found/disabled). Rust side populates code for Error::UnknownService/Disabled/Cycle and IPC permission/busy errors. - FollowLogs: add Client.ReadTimeout + ReadFrame enforcing a per-frame idle read-deadline so a silent server is detected, not blocked forever. - supervise.Host: use exec.Command (not CommandContext) so ctx cancel sends SIGTERM (soft-kill) letting microinit stop its services, then escalates to SIGKILL after ShutdownTimeout. Drop the redundant double List() in EnsureRunning. Bound the spawn log buffer to 256KiB. - config: drop-ins now 0o600; add config.ShellQuote/BuildStartCmd helpers to dedupe shell quoting across callers. - tests: readFrame too-large, code mapping (+legacy fallback), read-deadline, streaming decode; EnsureRunning spawn-fail, pre-ready exit, ready-timeout, ConfigPath-required, ctx-cancel SIGTERM. Co-authored-by: Cursor <[email protected]>
Replace restart bool with restartPolicy (always/onError/none), add log stream heartbeats, fix boundedBuffer short writes, use process-group signals with a 15s shutdown budget, write pid+starttime for embedders, and harden Go IPC framing (writeFull + exact frame reads). Co-authored-by: Cursor <[email protected]>
keskad
force-pushed
the
feat/go-sdk-config-supervise
branch
from
August 5, 2026 07:58
54e4a09 to
4e4a007
Compare
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
2 tasks
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
go/config(ServiceDef, drop-ins, BaseConfigServiceNames).go/supervise(join/spawn Host; Shutdown only if spawned).docs/sdk/golang.md,docs/developer.md, index updates.go/v0.2.0.Test plan
cd go && go test ./...Made with Cursor