Repository navigation
fix(merge): carry defaults.buildkit through the unified merge - #448
Conversation
mergeBoxConfig copies BoxConfig field by field with dst-wins, and Buildkit was not in the list: a project that authored defaults.buildkit had the block validated by the #NodeDoc gate and then silently dropped by the walk->materialize merge, so the build drive always saw Defaults.Buildkit == nil and rendered the sdk defaults instead (opencharly/charly#1306). One field, one test; the red arm fails on the unmodified merge. *Agent: `jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5` · OpenCode session `ses_de3fa473bffeFiBo62whHxDPE5`* *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
Review — BLOCKHead SHA: Change class: code — spec module merge logic (2 files: Security screen: PASS — the diff adds one field to an existing per-field merge plus a test; no scope mismatch, no secrets/egress, no guardrail or rulebook weakening, no new deps. Blocks
Comment intake: 0 comments on the thread — nothing to disposition. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…s failure mode The missing Buildkit entry (opencharly/charly#1306) was a trap in the shape of the code: the list is hand-maintained and a missing field is a silent drop. The comment now states the invariant and names the test pattern that keeps it. *Agent: `jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5` · OpenCode session `ses_de3fa473bffeFiBo62whHxDPE5`* *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
|
STATUS New head 1. R12 — B and C are now SPIKED, with pasted output. Candidate B (whole-Defaults replacement) — implemented as An import's block overwrote the root's Candidate C (second reader from the envelope) — a value/identity probe on The envelope carries a copy of the SAME merged value, so it sees the same 2. A1 — the compliance section is complete. R3 (no workaround: the field joins the existing merge), R4 (product fix first), R6 (clean status, Also in this head: the field list is marked hand-maintained with its failure mode named — this bug was a trap in the shape of the code (a missing entry is a silent drop), so the comment states the invariant and the test pattern that keeps it. Gate on the head: RCA for the missed control. Mechanism: I labelled B and C "rejected by inspection" while the rulebook requires an instrument for every plausible candidate — B was in fact cheap to implement and its failure is decisive. Missed control: the spike step was applied to the chosen candidate only, not to every candidate the analysis lists. Blast radius: a BLOCK on a one-line fix whose alternatives were never measured. Root fix: both candidates now run, with their output pasted. Agent: |
Review — PASSHead SHA: Security screen: PASS — the diff adds one field to the existing per-field Checklist: All applicable rules PASS or NA. The changed code path (the new Comments:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
mergeBoxConfig— the per-field, dst-winsBoxConfigmerge insideMergeUnified— copies everydefaults:field by hand, andBuildkitwas not in that list. So a project that authoreddefaults.buildkithad the block validated by the#NodeDocgate and then silently dropped by the loader's walk→materialize merge: the build drive always sawDefaults.Buildkit == niland rendered the sdk defaults instead (opencharly/charly#1306).One field, one test:
dst wins if setis preserved: a root document that states the block keeps it.How tested
TestMergeUnified_CarriesDefaultsBuildkitmerges adefaults.buildkitfrom an imported document into an empty root and asserts the values survive, then asserts root-wins.Red arm — the field removed from the merge again:
How it was found: a live project authored
max_parallelism: 2, reserved_space: 50GB, max_used_space: 60GB, min_free_space: 7GB;charly box validatesaid OK and the build succeeded, but the daemon config the drive wrote carriedmax-parallelism = 4and100GB/100GB/10GB(the sdk defaults). A plainyaml.Unmarshalintospec.UnifiedFileDID populateDefaults.Buildkit, which located the drop in the merge rather than in the schema or the decoder.Spike
RCA claim: the authored block survives validation and decoding but not the loader's merge.
Candidates:
Buildkitto the per-field merge (chosen). Instrument: the new test merges it and asserts the values; the red arm above is the pre-change behaviour. Works.MergeUnifiedreplace the wholeDefaultsstruct when src states the block. Spiked: implemented asif src.Buildkit != nil { *dst = *src }and run against the suite (-count=1):defaultsoverwrote the root document'sMaxParallelism: 9— it breaks the per-fielddst wins if setrule the rest ofBoxConfigrelies on. Eliminated by measurement.ProjectConfig(), which is what builds the envelope:Defaultsis a copy of the SAME merged value, so a second reader sees the samenil— C cannot recover what the merge dropped, and it would put a second reader beside the one merge (R2). Eliminated by measurement.Winner: A. RCA verdict: confirmed — the merge was the only place the block disappeared. The field list is now marked hand-maintained with its failure mode named, so the next new
BoxConfigfield cannot be added silently.Rulebook compliance
design/go/strict-policy/git-workflowloaded before the work.git statuswas clean before the branch; one commit on afix/branch off freshorigin/main; no destructive action, no force-push.specships nodisposable: trueentity. The consumer proof is the charly pin bump that follows this release, where the authored block must reachbuildkitd.toml(the live test that found it).#Buildkitalready exists (spec#447); this is the merge carrying it. No DESIGN amendment.Change classification
A bug fix in the merge: a project's
defaults.buildkitnow reaches the loader's materialized project instead of being dropped. Breaking change + rollback: none — the merge only gains a field; a revert restores the drop.Filed issues
None: this PR fixes opencharly/charly#1306 (it does not close it — the issue stays open until the consumer bump proves the block reaches the daemon).
Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)