feat(foreman): reconcile library for sliced-workload interface drift#1034
Merged
Conversation
Go port of the validated slicer reconcile core: PinnedCheck (deterministic,
whole-token presence, authoritative) + LLMSweep (injected ModelCaller,
degrades open on outage/malformed/NONE, advisory) + Reconcile composing them.
Drift shape {Identifier, Slice, File, Kind} with kinds pinned-missing /
llm-flagged. Pure library with no controller wiring; the model client is
injected via the ModelCaller interface (wired in a follow-up). Ports the
experiment's test suite including the whole-token regression (a pin like
rocm_smi_gpu_temp must not be satisfied by rocm_smi_gpu_temperature).
Part of defilantech#1033
Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 10, 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.
What
First task of the Sliced Workloads epic (#1033): the
pkg/foreman/slicerreconcile library, a Go port of the validated slicer experiment core.PinnedCheck— deterministic, authoritative. Verifies each pinnedshared_identifierappears as a whole token (not a substring) in every slice that defines or references it; absence yields apinned-missingDrift.LLMSweep— advisory. Asks an injectedModelCallerto flag unpinned drift, emittingllm-flaggedDrifts. Degrades open: any transport error, or an empty /NONE/ unparseable / non-list completion, yields no drifts and never fails, so a model outage never blocks reconciliation.Reconcile— composes the two;Cleanis true only when neither produced a drift.Why
The slicer decomposes an issue into disjoint-file slices; the union builds clean but is blind to semantic interface drift between slices (a dashboard querying a metric an exporter never emits). Validated live on #700 and #1001, where a green build hid broken integrations that this check caught. This is the foundational, self-contained piece; it has no controller wiring yet.
How
Pure library. The model transport is injected via the
ModelCallerinterface, so the library never constructs a client or makes a network call; Foreman's model client is wired in a follow-up task. Whole-token matching is a manual boundary scan (Go's RE2 has no lookbehind), faithful to the experiment's non-identifier-char lookaround.Testing
go test ./pkg/foreman/slicer/— 9 test functions covering the experiment's suite, including the whole-token regression (a pinrocm_smi_gpu_tempmust not be satisfied by the different metricrocm_smi_gpu_temperatureor a_degCsuffix) and the degrade-open paths (error / NONE / malformed). Build, vet, gofmt, golangci-lint all clean.Checklist
go test/go vet/gofmt/golangci-lintclean on the packagePart of #1033
Assisted-by: Claude Code (Opus 4.8), porting a design and test suite the author validated live; reviewed and verified by the author.