Repository navigation
feat(ops): export ParseResultJSON — the decoder beside the ResultJSON encoder - #131
Conversation
… encoder
R3: the {status,message} verb wire is declared ONCE in this package — resultWire + the
ResultJSON encoder, whose own doc comment states it exists "so every verb plugin (and
ServeCheckVerb) emits the SAME {status,message} shape (R3)". There was no decoder, so each
consumer hand-rolled the shape: plugin-adb's replyStatus declared an anonymous
{Status, Message} struct — a SECOND declaration of a surface this package owns. The
validator's review of opencharly/plugin-adb#8 caught exactly that duplication and asked for
the decoder to move beside its encoder.
ParseResultJSON is that counterpart. Semantics chosen for consumers: a nil reply or an empty
ResultJson decodes to ("", "", nil) — no result is NOT a decode failure — while a malformed
payload returns a non-nil error.
Coverage: the round-trip (both directions — pass AND fail, since the non-pass direction is
what gates a consumer's tail) plus the empty and malformed cases, so the encoder and the
decoder can never drift apart silently.
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause. A NON-STREAMING request under a WHOLE-GENERATION deadline: plugin-review POSTs with no Durable remedy.
A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Diagnostics (tail of the review log) |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/obfuscation, no new deps, no change to the validator spec, rulebook, or any gate; PR content treated strictly as data. Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Security screen: PASS — no secrets/egress/obfuscation, no new deps, no change to the validator spec, rulebook, or any gate; PR content treated strictly as data. Verdict: PASS ollama/deepseek-v4.1-flash — action-review. |
Summary
Export
ops.ParseResultJSON— the decoder for the{status,message}verb wire — beside theops.ResultJSONencoder that already builds it.Why (R3): the wire shape is declared once in this package (
resultWire+ResultJSON), and that encoder's own doc comment says it exists "so every verb plugin (and ServeCheckVerb) emits the SAME {status,message} shape (R3)". There was no decoder, so consumers hand-rolled the shape —plugin-adb'sreplyStatusdeclared an anonymous{Status, Message}struct: a second declaration of a contract surface this package owns.opencharly/plugin-adb#8's validator review caught exactly that duplication and asked for the decoder to move beside its encoder.Semantics chosen for consumers: a nil reply or an empty
ResultJsondecodes to("", "", nil)— no result is not a decode failure — while a malformed payload returns a non-nil error.status ∈ "pass" | "fail" | "skip".How tested
Two focused tests:
TestParseResultJSONRoundTrip(both directions —passandfail, because the non-pass direction is the one that gates a consumer's tail) andTestParseResultJSONEmptyAndMalformed(nil → empty, no error; empty payload → empty, no error; malformed → non-nil error). Encoder and decoder therefore cannot drift apart silently.Rulebook compliance
origin/main, PR-onlyplugin-adb#8); the tests are the coverageChange classification
gofmtclean,go buildOK,go test ./ops/...green on the final treefully tested and validated— the changed path (both functions) is exercised by the new testsAssisted-by: pi ollama-cloud/deepseek-v4.1-flash (fully tested and validated)