Skip to content

fix(build): propagate a plugin compile failure as a fatal error, not a warning - #2

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/plugin-compile-fatal
Aug 28, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/plugin-compile-fatal

Conversation

@atrawog

@atrawog atrawog commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The build-time plugin connect leg (buildengine-connect-plugins) failure was emitted as a warning and the build continued, dying later on no provider registered — an error naming the wrong cause. The host leg now returns the error (companion PR opencharly/charly#414); this caller propagates it so the build stops immediately with the actionable message (the plugin name + the go build error).

This is deliberately ALL build-time plugin connect failures — a compile failure, a missing module, or a download error — not only compile failures: the host leg loads only the plugins the build REFERENCES (collectReferencedPluginWords), so a connect failure means a plugin the build needs could not be loaded. Continuing would surface the misleading no provider registered error.

Fixes opencharly/charly#326.

How tested

Committed regression test (B12): step 4 (the connect leg) is extracted into connectPluginsOrFatal so the fatal-vs-warning semantics are unit-testable without faking the loader/scan leg family. resolve_connect_fatal_test.go drives it with a fake executor whose buildengine-connect-plugins leg fails and asserts done=true with a fatal BuildResolveReply{Error: ...} naming the leg and the plugin; a second test asserts a successful connect is NOT fatal (done=false). Verified the failure test FAILS against the pre-fix warning behavior and PASSES with the fix:

$ GOWORK=off go test . -run "TestConnectPlugins" -v
=== RUN   TestConnectPluginsFailureIsFatal
--- PASS: TestConnectPluginsFailureIsFatal (0.00s)
=== RUN   TestConnectPluginsSuccessIsNotFatal
--- PASS: TestConnectPluginsSuccessIsNotFatal (0.00s)
PASS

# Reverted to the pre-fix warning behavior (done=false):
--- FAIL: TestConnectPluginsFailureIsFatal
    resolve_connect_fatal_test.go:64: a build-time plugin CONNECT failure must be FATAL (done=true), not a warning the build continues past (#326)

Runtime proof on an explicitly disposable: true target (check-compile-fatal in the reproduction project, declared disposable: true — never derived from the name). The disposable bed builds the broken-plugin box; its image-build phase triggers the plugin connect. The bed FAILS at image-build (937ms) with the actionable error — the fresh rebuild from the committed tree:

$ charly check run check-compile-fatal
charly check run check-compile-fatal: [image-build] START
charly check run check-compile-fatal: [image-build] FAIL after 937ms: exit 1
$ cat .check/check-compile-fatal/2026.240.1850/image-build.log
charly: error: command "build": buildengine-connect-plugins: build-time plugin load failed: plugin "broken-plugin" (source github.com/opencharly/broken-plugin): plugin "broken-plugin": go build in /tmp/pb-repro: exit status 1
               go: go.mod file not found in current directory or any parent directory; see go help modules

The build FAILS immediately with the actionable error — ZERO warnings (the warning is replaced by the fatal error). Before the fix, the same reproduction emitted warning: build-time plugin load: ... and the build continued to the build steps.

Module gate: go build ./... clean, gofmt -l clean, GOWORK=off go test ./candy/plugin-build/ passes (full suite green).

Rulebook compliance

Rule Status
R0 (skills) The plugin-build candy skill (/charly-build:build) was loaded and followed
R1 (RCA) The warning-vs-fatal asymmetry was reproduced live on a disposable:true target and traced to this caller
R2 (no split) No surfaced issue is deferred; the change is fully in-scope
R3 (no duplication) One propagation point; the host leg owns the error; the connect-failure logic is extracted once (connectPluginsOrFatal)
R4 (no workarounds) The error is propagated, not swallowed or retried
R5 (hard cutover) The warning path is deleted, not kept alongside; git grep for the warning string returns no live hits
R6 (git safety) feat/ branch, no force-push, no direct push to main
R7 (gate) The committed regression test is the gate; it FAILS without the fix
R8/R9 N/A — no generated artifacts or binary-equality surface in this change
R10 (fresh proof) Disposable:true bed run from the committed tree; the changed runtime path ran live with retained output
ADE N/A — no baked plan surface in this change
B12 (coverage) Committed regression test that FAILS without the fix (verified)

Change classification

  • Change class: bug fix (build error reporting)
  • Verification gate: committed B12 regression test + live disposable:true bed run + module gate
  • Attribution tier: analysed on a live system (the changed runtime path ran live with retained output; the disposable bed fails by design to prove the fatal behavior — the full green bed gate is not applicable to a deliberately-failing reproduction)

…a warning

The build-time plugin connect leg (buildengine-connect-plugins) failure was
emitted as a warning and the build continued, dying later on 'no provider
registered' — an error naming the wrong cause. The host leg now returns the
error (charly companion change); this caller propagates it so the build stops
immediately with the actionable message (the plugin name + the go build error).

Closes opencharly/charly#326.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 151f1da26b89 (branch: fix/plugin-build-fatal-compile-error)

Change class: code change (bug fix in candy/plugin-build/resolve.go)

Blocks

  1. B12/B17 — runtime proof does not name a disposable: true target. The body's runtime evidence is a live reproduction on test-box (charly box build test-box), but it never states the target is explicitly marked disposable: true. Per B12, "Runtime proof claims a disposable: true target only," and per B17 the disposable status must be explicit, never derived from a name. The body must name a target explicitly marked disposable: true and state the fresh charly update/rebuild at zero warnings.

  2. T3 — scope mismatch: code makes ALL connect failures fatal, description claims only compile failures. The description frames the fix narrowly ("A plugin candy that fails to COMPILE must stop the build"), but the code returns a fatal error for any hostVoidLeg failure (resolve.go:105-107). The removed comment explicitly documented the prior design as best-effort: "a connect failure warns; a plugin the build actually USES fails loudly later at OpEmit/OpResolve" — i.e. connect failures for plugins the build does not use were intentionally tolerated. The new code removes that tolerance for every connect failure, which is broader than the described "compile failure" fix. The author must either narrow the code to fail only on compile failures, or update the description to account for the behavior change (all build-time connect failures are now fatal).

Verdict: BLOCK


ollama/deepseek-v4-flash — pi-review-action.

View action run

…ilures (T3)

The code makes every build-time plugin connect failure fatal — a compile
failure, a missing module, a download error all stop the build with the
actionable error. The prior comment framed it as only compile failures.
Update the comment to state the honest scope: the host leg loads only the
plugins the build REFERENCES, so a connect failure means a needed plugin
could not be loaded — continuing would surface a misleading
'no provider registered' error (charly#326).
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: f2168b77e583 (branch: fix/plugin-build-fatal-compile-error)

Change class: code change (bug fix in candy/plugin-build/resolve.go)

Security screen: PASS — no T1–T4 findings. No scope mismatch (the body now explicitly scopes the change to ALL connect failures, matching the code), no secrets/exfiltration, no weakened guardrails, no supply-chain changes.

Blocks

  1. B12 — no test coverage shipped in the diff. The change adds new behavior (a build-time plugin connect failure is now a fatal error instead of a warning) but the diff contains no test or check that would fail without it — only resolve.go is modified. The body's runtime proof is a live reproduction bed (check-compile-fatal) run from an external /tmp/pb-repro project, not a committed check in this repo. Per R10, "a change whose new behavior has NO test that would FAIL without it BLOCKS," and the rule explicitly flags "new code is added with no test/hook in the diff." The author must add a regression test (a check bed in the candy, or a unit test that asserts a hostVoidLeg failure returns a fatal BuildResolveReply{Error: ...} rather than a warning) that would fail without this change.

The two prior github-actions[bot] blocks are resolved in the current state: the body now names a disposable: true target (check-compile-fatal) with pasted output, and the body now explicitly states ALL connect failures are fatal, matching the code (commit f2168b77 scopes the comment accordingly).

Verdict: BLOCK


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: f2168b77e583 (branch: fix/plugin-build-fatal-compile-error)

Change class: code change (bug fix in candy/plugin-build/resolve.go)

Security screen: PASS — no T1–T4 findings. No scope mismatch (the body now explicitly scopes the change to ALL connect failures, matching the code), no secrets/exfiltration, no weakened guardrails, no supply-chain changes.

Blocks

  1. B12/R10 — no test coverage shipped in the diff. The change adds new behavior (a build-time plugin connect failure is now a fatal error instead of a warning) but the diff modifies only resolve.go — no test or check is added that would fail without this change. The body's runtime proof is a live reproduction bed (check-compile-fatal) run from an external /tmp/pb-repro project, not a committed check in this repo. Per R10, "a change whose new behavior has NO test that would FAIL without it BLOCKS," and the rule explicitly flags "new code is added with no test/hook in the diff." The author must add a regression test — a check bed in the candy, or a unit test asserting a hostVoidLeg failure returns a fatal BuildResolveReply{Error: ...} rather than a warning — that would fail without this change.

  2. A1 — incomplete rulebook-compliance section. The body's compliance table lists only R1, R3, R4, R6, R10. The template requires EVERY applicable rule answered with a one-line HOW (or N/A — <reason>). For this change class, R0 (skills honored for the plugin-build candy), R2 (no pre-existing/out-of-scope split), R5 (hard cutover/grep sweep), R8/R9, and the ADE/SDD gates are applicable-or-excluded and must each be explicitly answered or marked N/A — <reason>. Add the missing rows.

The two prior github-actions[bot] comments were re-derived against the current state: the first comment's B12/B17 (no disposable target named) and T3 (scope mismatch) findings are stale-superseded — the current body names check-compile-fatal declared disposable: true with pasted output, and explicitly scopes the change to ALL connect failures. The second comment's B12 finding is verified-blocking and reproduces against the current diff.

Verdict: BLOCK


ollama/deepseek-v4-flash — pi-review-action.

View action run

… test (B12, #326)

Extract resolveBuildEngine step 4 (the build-time plugin CONNECT leg) into
connectPluginsOrFatal so the fatal-vs-warning semantics are unit-testable
without faking the entire loader/scan leg family. The test asserts a connect
failure returns done=true with a fatal BuildResolveReply{Error: ...} naming
the connect leg and the plugin — it FAILS against the pre-fix warning
behavior (verified) and passes with the fix.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 7f3b5b109c5a (branch: fix/plugin-build-fatal-compile-error)

Change class: code change (bug fix in candy/plugin-build/resolve.go + new regression test)

Security screen: PASS — no T1–T4 findings. No scope mismatch (body explicitly scopes to ALL connect failures, matching the code), no secrets/exfiltration, no weakened guardrails, no supply-chain changes.

Blocks

  1. A1 — incomplete rulebook-compliance section. The body's compliance table lists only R1, R3, R4, R6, R10, and B12. The template requires EVERY applicable rule answered with a one-line HOW (or N/A — <reason>). For this change class the following are applicable-or-excluded and must each be explicitly answered or marked N/A — <reason>: R0 (skills honored for the plugin-build candy), R2 (no pre-existing/out-of-scope split), R5 (hard cutover/grep sweep), R7, R8/R9, and the ADE/SDD gates. Add the missing rows.

Comment intake

  • Comment 1 (B12/B17 no disposable target; T3 scope mismatch): stale-superseded — current body names check-compile-fatal declared disposable: true with pasted output, and explicitly scopes the change to ALL connect failures, matching the code.
  • Comment 2 (B12 no test shipped): stale-superseded — current diff adds resolve_connect_fatal_test.go, a committed regression test asserting the fatal-vs-warning semantics.
  • Comment 3 (B12 no test; A1 incomplete compliance table): B12 portion stale-superseded (test now added); A1 portion verified-blocking — the compliance table is still incomplete against the current body.

Verdict: BLOCK


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 7f3b5b109c5a (branch: fix/plugin-build-fatal-compile-error)

Change class: code change (bug fix in candy/plugin-build/resolve.go + new regression test)

Blocks

  1. A1 — incomplete rulebook-compliance section. The body's compliance table lists only R1, R3, R4, R6, R10, and B12. Per A1, the body must answer EVERY applicable rule with a one-line HOW (or N/A — <reason>). For this change class (a code change in the plugin-build candy), the following are applicable-or-excluded and must each be explicitly answered or marked N/A — <reason>: R0 (skills honored for the plugin-build candy), R2 (no pre-existing/out-of-scope split), R5 (hard cutover/grep sweep), R7, R8/R9, and the ADE/SDD gates. Add the missing rows.

Comment intake

  • Comment 1 (B12/B17 no disposable target; T3 scope mismatch): stale-superseded — current body names check-compile-fatal declared disposable: true with pasted output, and explicitly scopes the change to ALL connect failures, matching the code.
  • Comment 2 (B12 no test shipped): stale-superseded — current diff adds resolve_connect_fatal_test.go, a committed regression test asserting the fatal-vs-warning semantics.
  • Comment 3 (B12 no test; A1 incomplete table): B12 portion stale-superseded (test now added); A1 portion verified-blocking — the compliance table is still incomplete against the current body.
  • Comment 4 (A1 incomplete table): verified-blocking — reproduces against the current body.

Verdict: BLOCK


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 19e4fd028a87 (branch: fix/plugin-build-fatal-compile-error)

Security screen: PASS — no T1–T4 findings. No scope mismatch (body explicitly scopes to ALL connect failures, matching the code), no secrets/exfiltration, no weakened guardrails, no supply-chain changes.

Checklist: All applicable rules PASS or NA.

  • A1 — Body supplies a complete Summary, How-tested (committed B12 regression test + disposable:true bed run + module gate, with pasted output), a justified attribution tier, and a full rulebook-compliance table (R0–R10, ADE, B12 each answered with a one-line HOW or N/A — <reason>). The prior A1 "incomplete table" finding is stale-superseded against the current body.
  • A2/A3 — Code-change gate met: fresh-rebuild disposable:true bed (check-compile-fatal) with pasted output; the changed fatal path ran live; tier "analysed on a live system" is not inflated (the bed fails by design to prove fatal behavior).
  • B12/R10 — Regression test resolve_connect_fatal_test.go ships in the diff and the body shows it FAILS against the pre-fix warning behavior and PASSES with the fix. Runtime proof names a disposable: true target with ZERO warnings.
  • R1/R2/R3/R4/R5 — RCA provided; no deferred split; single propagation point (connectPluginsOrFatal); error propagated not swallowed; warning path deleted (no live hits).
  • B16 — placement: CORRECT (capability lives in the plugin-build candy; no new core imports, no alias files).
  • B18 — diff is gofmt-clean; the trailing // see resolve_connect_fatal_test.go comment is a harmless stylistic oddity, not a blocker.

Comment intake: all four prior github-actions[bot] comments are stale-superseded — the current body names a disposable: true target with pasted output, scopes to ALL connect failures, ships the regression test, and has a complete compliance table.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant