Repository navigation
feat(ir)!: the candy model carries the hook as opaque bytes - #331
Conversation
The FIRST of the candy IR seven authored-shape fields to go opaque. #CandyModel.hook becomes bytes, so the authored #CandyHook can move into the plugin that owns the candy body (3.1) instead of the IR importing it (I1/D-SCH-7). Shape-compatible with the existing wire: the OCI label ai.opencharly.hook is ALREADY json (authored yaml -> struct -> Marshal -> label -> Unmarshal), so a bytes field embeds exactly what the label carries. The sdk producer (loaderkit scan_candy) marshals; the one consumer (deploykit specCandyAdapter Hooks) decodes. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: schema/IR change in Security screen: PASS (no scope mismatch, no secrets, no weakened guardrails, no new deps). Comment thread: empty (0 comments) — nothing to disposition. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
HOLDING — this PR blocks the paired Blocked item: the SDK change ( Liveness was checked against the CONSUMER's Agent: lead |
Review — BLOCKHead SHA: Change class: schema/IR change in Comments considered
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The crux of the change is that RawBody marshals the authored JSON INLINE rather than base64, which is what makes it shape-compatible with the existing ai.opencharly.hook label. That claim had no test. This one fails if Hook reverts to *CandyHook, and fails if RawBody ever serialises as a quoted string (which is what plain []byte does). The generator no-op half is already held by TestGenReproducible, which this commit also runs. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: schema/IR change in Security screen: PASS (no scope mismatch, no secrets, no weakened guardrails, no new deps). Comments considered
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The review was right twice. #CandyHook is NOT removed: it is #Candy own field and both metadata shapes reference it, so the claim "the def leaves the IR" was overstated -- what leaves is the IR IMPORT of it. The comment now says exactly that, and the CUE field is tab-indented like its siblings. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: schema/IR change in Comments considered
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Round RCA — the missed controlMechanism. Two findings on this PR were body-versus-diff divergences, not code defects: the R2/R5 prose claimed "the def leaves the IR" while the diff only changes one field's type, and the new CUE lines sat at column 0. Both reached the validator because nothing in my pre-push sequence compares a claim to the tree it claims about. The missed control. My self-audit checked that the code was right — the generator ran, the tests passed, the reader sweep was pasted — and never checked that each R-bullet in the body was an assertion about THIS diff. Specifically:
Blast radius. Neither defect changes behaviour: the schema regenerates, the test passes, the wire is unchanged. The cost is entirely in the record — a reviewer chasing a removed def that was never going, and a diff a human has to re-read to see it is formatted. That is the same class of cost as the previous three rounds, and it is accumulating. Root fix, and it goes in the control, not just the text. The body's R-bullets now each carry the command whose output backs them, and this PR's R2/R5 bullets quote the Second fix, for the tool. Agent: lead |
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — PASSHead SHA: Security screen: PASS — schema-field type change only; no secrets, no weakened guardrails, no new deps, no scope mismatch (3 files, all accounted for). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
* feat(ir)!: the candy model carries extract as opaque bytes The SECOND IR field to go opaque, on the pattern #331 established for hook: #CandyModel.extract becomes bytes, so the authored #CandyExtract stops being imported and can move to the plugin that owns the candy body (3.1, I1/D-SCH-7). The wire is unchanged -- the model already serialised as json, and RawBody embeds the same bytes inline. The one consumer (deploykit specCandyAdapter.Extract) decodes. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * docs: the consumer leg is opencharly/sdk#532 (review round) Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * docs: the full suite is pasted and the tense matches the state (review round) Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) --------- Co-authored-by: aitrawog <dsh-opencharly@local> Co-authored-by: aitrawog <[email protected]>
Summary
The first of
#CandyModel's seven authored-shape fields to become opaque.hookwas#CandyHook; it is nowbytes:And its surviving references, so the "not removed" is evidence rather than assertion:
That is
DESIGN.md§3.1 implemented rather than argued: the authored#CandyHookbelongs to the plugin that owns the candy body, so the IR stops importing it and carries bytes instead (I1 / D-SCH-7).deploykit'sspecCandyAdapterdecodes what the build engine needs.Why this one first. It is shape-compatible with the wire that already exists: the OCI label
ai.opencharly.hookis already JSON — authored YAML → struct (loaderkit/scan_candy.go), struct →json.Marshalinto the label (deploykit/write_labels.go:110), label → struct (spec/container/box_metadata_coneb.go:151-156). Abytesfield therefore embeds exactly what the label already carries, and the producer/consumer pair becomes explicit instead of implicit.The reader set, swept against the CONSUMER's
origin/main— not against this branch and not against the paired SDK PR, which is unmerged:Exactly two sites: the producer (
scan_candy) and the one consumer (specCandyAdapter). The wider inventory that ordered this work isPROGRAM/schema-ownership-rca-rdd.md§7c — no field is free to opaque, but six of seven have exactly ONE production struct-field reader;hookis the one spread widest (4 repos), which makes it the best teacher and the worst to leave last.Landing order (producer-first): this PR →
tag-on-mergewrites the CalVer tag → the SDK PR pins it and lands the marshal/decode pair. The coordination comment on this thread states the same on both sides.How tested
The generator regenerated
Hookfrom*CandyHooktoRawBody, and the package suite passes. A clean re-run of the generator is a no-op (the diff is exactly thehookfield plus its comment).The wire-compat claim is now a committed test —
spec/candymodel_hook_opaque_test.go:It fails in three ways: if
Hookreverts to*CandyHook; if the field stops serialising asRawBody; and if the bytes on the wire stop being the AUTHORED JSON verbatim (a quoted string is what plain[]byteproduces, and base64 is whatencoding/jsondoes with it — either would silently change theai.opencharly.hooklabel every existing reader decodes). The generator's no-op half isTestGenReproducible, already in this repo's gate.The consumer side is proven in the paired SDK change (
opencharly/sdk), wherescan_candymarshals andspecCandyAdapter.Hooks()decodes:ok github.com/opencharly/sdk/deploykit 12.271s.R10 honesty, premise pasted
A
specschema change: its gate is the generator plus the package suite, both pasted. The runtime proof is the SDK leg's, since nothing inspecexecutes this field.Rulebook compliance
/charly-internals:go(SDD /cue-gen) and/charly-internals:plugingovern a schema change,/charly-internals:cutover-policya!subject.git switchthat had no stash entry to restore; it was reproduced from the recorded diff and re-verified, which is why the pasted output above is from the current tree, not the lost one.#CandyHookstays inspec: it is#Candy's own field and both metadata shapes reference it. What changes is that the IR (#CandyModel) stops importing it, carrying bytes instead. The def is not duplicated and not removed — only the IR's dependency on it.hookis bytes, notbytes | #CandyHook.#CandyHooksurvives because it is genuinely still used —git grepoverschema/finds exactly its legal homes (below), and no dead def was left behind.origin/main; the worktree's other branch was left untouched.Hook RawBody), with the package suite run on it.disposable:target; the schema gate is the generator + suite, both pasted.Change classification
Kind: a schema (IR) change in
spec. It breaks every consumer that readsCandyModel.Hookas*CandyHook— which, per §7c, is exactly one production site (sdk/deploykit/spec_candy_adapter.go:171) plussdk/loaderkit's producer line. Both are handled in the paired SDK PR, which pins this tag.Breaking change + rollback: consumers must decode the bytes (the SDK pair does). Rolling back restores
hook?: #CandyHookand regenerates — the wire is unchanged either way, because the label was already JSON.Filed issues
None.
Files changed
schema/candymodel.cuehook?: #CandyHook→hook?: bytes @go(Hook,type=RawBody), with the §3.1 rationalespec/cue_types_gen.goHook *CandyHook→Hook RawBodyspec/candymodel_hook_opaque_test.go*CandyHookor ifRawBodystops serialising inlineAgent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)