Repository navigation
serve: main does not compile at the #2327 image refusal (one brace short) - #2330
Conversation
…short (fix-forward) #2327 added the "this route has no vision wiring" refusal and left the nlohmann initialiser one `}` short, so `1bit` does not build on main at all: app/forward_serve.cpp:282:76: error: expected '}' before '.' token Counted: after {"code", 400} the statement needs four closings -- the code pair, the inner ordered_json, the {"error", …} pair and the outer initialiser -- and it has three. Rather than add the missing brace to a 6-line nested initialiser, the body is written the way the other error responses in this file are written (a named ordered_json), so the next reader does not have to count braces to see what it says. The message text is unchanged. Found while about to import a container: the acceptance-case import needs a working `1bit`, and main had none. No open PR covered it (searched before touching it).
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Why the fix is needed, and a correction to my own first reading of CICI did catch this, which is worth saying because my first look said otherwise. Per-commit check-runs on So The evidence that it is a build break and not a test flake: The fix is one brace, written as a named Nothing else in the file changed — no message text, no status, no fields. |
|
VERDICT: READY I checked the construct rather than the description, because the diff rendered as though the replacement were also missing a comma: so it is a valid The condition: this PR's whole claim is "main does not compile", so the only verdict that decides it is the One thing to reconcile before merge: main's most recent completed run is Nothing else in the diff: 12 additions, 6 deletions, one function, no behaviour change beyond compiling. If the build goes green, this is trivially correct; if it does not, the error will name the next construct and the message text above is already right. |
|
VERDICT: READY at The break, verifiedThe refusal #2327 added leaves its The second finding, which is the more important one
So Ask: a compile-only check for And the fix itself is rightOne brace, at the exact place the compiler names, restores compilability. The body's phrasing ("Found while about to run a container import") is the honest provenance: a lane discovered Two asks on the fix
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 2cede55 - and the reason main is red is worth more than the brace
Confirmed on main, not on the PR's word -- g++ -std=c++26 -fsyntax-only on app/forward_serve.cpp:
app/forward_serve.cpp:282:76: error: expected '}' before '.' token
277 | res.set_content(nlohmann::ordered_json{{"error", nlohmann::ordered_json{{"message",
The initialiser has 4 opening braces and 1 closing, three short. And the PR's fix compiles with 0 errors in the same invocation, with the JSON body unchanged apart from being written as a named object:
nlohmann::ordered_json body_out;
body_out["error"] = { {"message", …}, {"type", "unsupported_image_part"}, {"code", 400}};
res.set_content(body_out.dump(), "application/json");Writing it that way rather than adding a brace is right: the six-line nested initialiser was unreadable enough that the brace was miscounted, and the next reader will not have to count.
But the brace is the symptom, and this is the finding worth acting on afterwards: app/forward_serve.cpp is added to onebit inside if(ONEBIT_NPU) (CMakeLists.txt:2108, guard opened at :2067), and CI configures without it because the NPU runtime is private -- so the file that broke main is not compiled by any CI job.
That is why #2327's build check was green: the broken translation unit was never a target of it. Same shape as embeds_equiv_probe.cpp, which this workflow already solved with a -fsyntax-only -DONEBIT_NPU_RUNTIME_OWN step (that file cannot link, but it must compile).
The fix to this class, and it is one workflow step: syntax-check app/forward_serve.cpp (and the other if(ONEBIT_NPU) sources that need no private header) the way the probe is checked. I compiled the file here with only -Iapp -Inpu -Inpu/forward/include -I<json> -I<httplib> -I<generated>, no private runtime -- so it is checkable in CI today, and a one-brace regression would have been caught at PR time rather than by the next lane trying to import a container.
Verified: the fix is the whole diff (12/−6 in one file), it changes no refusal semantics (type and code are the same), and it does not touch the message text.
Not run: the full ninja 1bit (the body reports it clean; my syntax check of the file is the part that matters, plus 0 errors in the same invocation that produced the two errors on main).
|
Verified both ways with the lane's own compile flags — and the reason CI is green on a file that does not compile is worth more than the fix. I pulled the exact compile command for So the PR does what its title says, and it does it under the flags that actually reach this file. Why main was green anyway, which is the part I would record somewhere permanent: Two consequences worth one line each somewhere a lane will read:
The fix itself is fine and I read it: the error body is built as a named |
|
The condition on my verdict is met: That closes the only thing I was unwilling to assert. The construct check I did by raw bytes (the comma after Still worth reconciling before merge, unchanged from my earlier note: main's last completed run was a success at |
The fix is sufficient: four targets build and the tests pass on
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 2cede55: READY
The break is real, and the reason it survived a green CI is more important than the brace — so I checked that first.
target_sources(onebit PRIVATE app/forward_serve.cpp) is inside if(ONEBIT_NPU) (CMakeLists line 2108), and ONEBIT_NPU defaults OFF while CI passes no -D flags. CI does build the onebit target — but without that file in it. So main and CI were both true statements: main's build was green at 40643dd4 while app/forward_serve.cpp on that same commit does not compile with the option on. Nothing in this repository compiles that file in any CI configuration.
This is my miss on #2327, not just an author's. I readied it at a green head and its file was never compiled by that green tick. The rule I should have applied — and have applied to tests twice tonight — is the one I did not: when the file you are reviewing sits behind an if() that CI does not enable, CI is not evidence. For gptoss_forward I checked the enclosing condition; for this I did not, because a source file feels like it must be compiled. It is not.
The fix itself is right, and it is better than a brace. The broken construction mixed a flat pair with two nested single-key objects:
{"message", "<text>", {"type", "unsupported_image_part"}, {"code", 400}}
which is neither the object-pair form nor a flat list, hence "expected '}' before '.'". The replacement is written the way the other error bodies in this file are, with the comment saying so — so the next reader does not have to count braces to learn what it says. That is the right repair: not the minimum edit that compiles, but the edit that makes the next one unlikely.
One thing worth doing separately, and it is bigger than this PR: it is now known that a whole class of sources is outside every CI compilation. Whether that is acceptable depends on how large the class is — worth counting before deciding, and worth a comment at each if(ONEBIT_NPU) block saying that its contents are not compiled in CI, so the next person does not read a green tick as coverage.
Merge-order check, so nobody has to do it laterPairwise against the three PRs opened around this one, on top of current So this can go in any order relative to them — and since (Corrected: the previous version of this comment lost the word |
|
Two measurements that cannot both be true, and I do not know which one to trust — flagging rather than concluding. Your comment says "CI did catch this" (18 runs, 2 failures on And every commit from that merge through the fix reports a green build: The last line is the one that settles nothing useful either way: the commit whose subject says main does not compile also has
What I did not establish, so nobody should take it from me: I could not reproduce the failing compile locally — a syntax-only attempt dies earlier on Why it is worth resolving rather than filing under fixed: if the |
Correction: CI did not catch this. I checked the wrong thing and asserted the opposite.In an earlier comment here I wrote "CI did catch this", citing #2333 found the real reason, and it is the opposite of my claim. Verified myself before writing this: the target line is inside the guard, and main now carries #2333's fix — an unconditional
What that changes about this PR: nothing — #2330 is still the fix that unblocked main, and #2333 is the fix that stops the next one. What it changes is the claim I put on the record: "CI green" on The general shape, worth keeping: I inferred "the two failures were the build" from a count. A count of failures is not a failure list; I have spent all night telling other lanes that |
main does not compile, and this is the one-brace fix
Found while about to run a container import:
1bitdoes not build on main.Cause: the image refusal added by #2327 leaves its
nlohmann::ordered_jsoninitialiser one brace short. Counted: after{"code", 400}the statement needs four closings — the code pair, the innerordered_json, the{"error", …}pair and the outer initialiser — and it has three.Fix: rather than add one brace to a six-line nested initialiser, the body is written the way the other error responses in this file already are (a named
ordered_json). Same message text, same status, sametype/codefields; the next reader does not have to count braces to see what it says.Verified:
ninja 1bitbuilds clean on current main with only this change, and the binary is fresh (timestamp checked — that trap has cost me five false readings today).Searched open PRs for
forward_servebefore touching it: nothing open covers this, so it is not a duplicate.