Repository navigation
feat(loaderkit): route scan advisories through an injectable sink - #200
Conversation
PickCandyVersion wrote its skew advisory straight to stderr, and the local-shadow note did the same. Both were therefore unstructured and UNCOUNTABLE: `charly box validate` could not report how many warnings a run produced because they never reached its diagnostics, so its summary could only omit the number or state a false one. A first draft printed "0 warnings" on a run that had just emitted two. Backward compatible by construction. PickCandyVersion keeps its two-argument shape and delegates to the new PickCandyVersionWith, so existing callers and their tests compile and behave unchanged — plugin-loader calls the two-arg form and needs no repin. A caller wanting the advisory as DATA passes a collector via the new spec.ScanSeams.Warn seam; nil keeps stderr. Guards, with a negative control: the advisory reaches an injected sink, agreeing versions produce NO advisory (so a count cannot overstate), and the legacy two-argument form still arbitrates correctly. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — BLOCKHead SHA: Change class: library change (Go code in Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…ty shim
The first version of this change kept a two-argument PickCandyVersion delegating
to a PickCandyVersionWith variant, so existing callers compiled unchanged. That
is exactly the shim R5 forbids ("hard cutovers remove old names, paths, shims,
adapters, aliases") and what "Prioritize Clean Architecture Above All Else"
rules out: compatibility convenience never justifies weakening the target
architecture.
There is now ONE arbiter with a REQUIRED sink. Passing nil selects stderr
explicitly rather than by omission, so every caller states where its advisories
go. The sole external consumer, plugin-loader, is cut over in the same sweep
(opencharly/plugin-loader) rather than being carried by a shim.
Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — BLOCKHead SHA: Change class: library change (Go code in Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: library refactor (Go code in Security screen: PASS — no secrets, exfiltration, scope mismatch, or guardrail weakening. Routing warnings through an injectable sink is benign. Blocks
Comment dispositions
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: library refactor (Go code in Security screen: PASS — no secrets, exfiltration, scope mismatch, or guardrail weakening. Routing warnings through an injectable sink is benign. Blocks
Comment dispositions
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
spec v0.2026243.707 (opencharly/spec#85) publishes ScanSeams.Warn, so this branch no longer needs a local replace to compile. $ go build ./... && go test ./loaderkit/... ok github.com/opencharly/sdk/loaderkit 0.019s That clears the blocking objection: the committed tree now builds against the committed go.mod, so R10 is satisfiable in isolation rather than only with a replace pointing at an unmerged branch. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — BLOCKHead SHA: Change class: library refactor (Go code in Blocks
Comment dispositions
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, scope mismatch, or guardrail weakening; routing advisories through an injectable sink is benign. Checklist: All applicable rules PASS or NA. The prior blocking findings are resolved by the current state:
Comment dispositions:
Placement: CORRECT — the seam lives in Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
sdk v0.2026243.714 (opencharly/sdk#200) publishes the three-argument PickCandyVersion, so this branch builds against a published tag with no replace. $ go build ./... && go test ./... ok github.com/opencharly/plugin-loader/candy/plugin-loader 0.027s The compile itself is the proof the tag carries the cutover: this test calls PickCandyVersion with three arguments, which does not compile against the old two-argument form. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
…ink (#4) * refactor(loader): cut the version-arbiter test over to the advisory sink loaderkit.PickCandyVersion now takes a required advisory sink instead of writing to stderr (opencharly/sdk). This test redirected os.Stderr and scraped the bytes back to assert on the advisory — a workaround for advisories that had nowhere structured to go. The scraping is DELETED, not kept beside the sink: the helper now collects the advisory as data, and the bytes/io/os imports go with it. Same two assertions as before — agreeing versions must not warn, differing versions warn exactly once. Part of the same cutover as the sdk change rather than a follow-up, so no shim exists at any point. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6 * chore: require the tagged sdk carrying the required advisory sink sdk v0.2026243.714 (opencharly/sdk#200) publishes the three-argument PickCandyVersion, so this branch builds against a published tag with no replace. $ go build ./... && go test ./... ok github.com/opencharly/plugin-loader/candy/plugin-loader 0.027s The compile itself is the proof the tag carries the cutover: this test calls PickCandyVersion with three arguments, which does not compile against the old two-argument form. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6 --------- Co-authored-by: atrawog <[email protected]>
Summary
PickCandyVersionwrote its skew advisory straight to stderr, and the local-shadow note inScanCandyFromLocaldid the same:That made both advisories unstructured and therefore uncountable:
charly box validatecould not report how many warnings a run produced, because they never reached its diagnostics.
A draft of that summary printed
0 warningson a run that had just emitted two.Both now route through a sink supplied via
spec.ScanSeams.Warn.The sink is REQUIRED — no compatibility shim
The first version of this branch kept a two-argument
PickCandyVersiondelegating to aPickCandyVersionWithvariant, so existing callers compiled unchanged. That was wrong andis gone. It is precisely the shim R5 forbids — "hard cutovers remove old names, paths,
shims, adapters, aliases" — and what "Prioritize Clean Architecture Above All Else" rules
out: compatibility convenience never justifies weakening the target architecture.
There is now ONE arbiter with a required sink. Passing
nilselects stderr explicitlyrather than by omission, so every caller states where its advisories go. The sole external
consumer,
plugin-loader, is cut over in the same sweep (opencharly/plugin-loader#4) ratherthan carried by a shim.
Merge ordering — resolved
This branch originally could not compile against its committed
go.mod, because it usesScanSeams.Warnfrom opencharly/spec#85. That PR is now merged and tagged, and thisbranch requires it:
No
replaceand no caveat. Verified from a clean clone of the pushed branch, not a localworking copy that might carry stale state:
Remaining chain order, for the consumers of THIS change:
feat(scan): add an optional Warn seam so scan advisories can be data spec#85 — themerged, tagWarnseamv0.2026243.707charly box validatereports the countHow tested
With a
replacepointing at the spec branch — the only way this compiles until spec#85 tags,per the ordering section above:
Three guards, each pinning something a counted total depends on:
per-entity version
nilsink still arbitrates correctly, since nil now means "stderr, explicitly"Negative control — suppressing the advisory emission:
End to end, with charly built against this branch plus the rest of the chain:
Three warnings — two skew, one shadow note — now counted instead of lost to stderr.
Built against the matching
specbranch via a localreplace, dropped before committing:the committed
go.modis unchanged.Rulebook compliance
/charly-internals:pluginfor the loader/host boundary;/charly-internals:git-workflowfor PR-only landing.0 warningssummary to these two stderr writes;reproduced in a test rather than assumed.
grepforPickCandyVersionWithreturns nothing.replace: spec#85 ismerged and tagged, and this branch requires
v0.2026243.707. Recording the history becausean earlier version of this line claimed tests ran with the replace removed when they could
only run with it — that was false, the reviewer flagged it, and the fix was to land the
dependency rather than reword the claim.
Change classification
plus guards. Breaking by design; the one consumer is cut over in the same sweep.
go build+go test ./loaderkit/...with a negative control, and alive end-to-end run
fully tested and validated— the changed path is exercised by teststhat fail without it and by the live run pasted above
Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)