Skip to content

fix(validate): an INFO-tier skew is not a validation error - #100

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/validate-info-tier
Nov 23, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/validate-info-tier

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

charly box validate turned every non-warning diagnostic into a validation error. The verdict
filter skipped only SeverityWarning, so SeverityInfo fell through, was printed inside
N validation errors: and made the command exit 1 — for a candy-version skew the resolver has
already arbitrated deterministically.

Two in-tree contracts say that is wrong:

  • sdk/loaderkit/candy_version.go emits the skew at DiagInfo: "a resolvable skew is INFO, never
    WARNING … a consumer's zero-warnings gate is for unresolved defects and must not fail on a
    successful arbitration."
  • spec.SeverityError: "the only tier a verdict may turn into a non-zero exit."

The verdict now uses the canonical Diagnostic.IsError() predicate (which fails closed on an
unknown tier), and info-tier observations are printed as notice: … so they stay actionable
rather than merely counted.

Why this matters (the finding it removes)

Any pin advance that leaves two candies in one box scope naming different tags of the same repo —
the normal shape of a wave — made validate red. Observed while releasing a consumer change:

$ charly box validate -C <distro-cachyos checkout>
Notice: candy github.com/opencharly/layer-supervisord resolved to multiple git tags …
Notice: candy github.com/opencharly/pod-ollama resolved to multiple git tags …
charly: error: command "validate": 2 validation errors:
  candy github.com/opencharly/layer-supervisord resolved to multiple git tags …
  candy github.com/opencharly/pod-ollama resolved to multiple git tags …
(exit status 1)

Filed as opencharly/charly#1256 with the full trace; this change is its fix.

How tested

# head ae97a0be417b8f5057cb227fa0fd37c178a46c6d (git rev-parse HEAD)
$ cd candy/plugin-box && GOTOOLCHAIN=go1.26.8 go test ./...
ok  	github.com/opencharly/plugin-box/candy/plugin-box	0.145s
?   	github.com/opencharly/plugin-box/candy/plugin-box/cmd/serve	[no test files]

$ gofmt -l candy/plugin-box/validate.go candy/plugin-box/validate_info_tier_test.go
(no output)

The regression test is red without the fix (R7 — a test that cannot fail is invalid). With
validate.go reverted to the previous head and the new test kept:

--- FAIL: TestValidateVerdictDoesNotFailOnInfoTier (0.00s)
    validate_info_tier_test.go:51: an INFO-tier, already-arbitrated skew must not fail the gate,
    got: 2 validation errors:
FAIL	github.com/opencharly/plugin-box/candy/plugin-box	0.009s

and green with it. TestValidateVerdictStillFailsOnErrorTier covers both the error tier and an
unknown/empty severity, so the widening cannot silence a real failure.

Rulebook compliance

  • R0 — loaded /charly-internals:root-cause-analyzer, /charly-internals:strict-policy,
    /charly-internals:go, /charly-internals:go-quality and /charly-internals:git-workflow for
    this work.
  • R1 — root cause traced through three files before any edit (the emitter's level, the severity
    model, the verdict's filter); the finding is fixed here and its issue (charly#1256) will be
    closed explicitly after merge.
  • R2 — reuses the canonical Diagnostic.IsError() predicate instead of a second severity
    ladder; the old inline == "warning" test was the duplicate.
  • R3 — no workaround: the verdict stops gating observations rather than the consumer
    suppressing them.
  • R5 — the stale == "warning" filter and its misleading comment are deleted outright.
  • R6 — N/A — nothing destructive: no force-push, reset, history rewrite, hook bypass or
    direct push to main.
  • R7 — the new test fails without the change (pasted above).
  • R8 — N/A — no live-service boundary in this change.
  • R9 — N/A — no charly binary change in this repo; the plugin is go tested here.
  • R10 — the package's full test suite is the change-class gate and it passes on this head; the
    behavioural proof in charly box validate itself lands when the next charly build carries this
    plugin (the consumer leg re-validates then).
  • R11 — no design field/shape/mechanism; a verdict severity rule corrected to its documented
    contract.

Change classification

  • Class: plugin logic (one predicate + one print branch, one new test file).
  • Impact: charly box validate no longer exits non-zero on an already-arbitrated skew; it
    prints notice: … and still reports 0 warnings, 0 errors. Genuine errors and warnings behave
    exactly as before.
  • Rollback: revert the commit; the previous (over-strict) verdict returns.

Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

`charly box validate` turned EVERY non-warning diagnostic into a validation error.
The verdict filter skipped only `SeverityWarning`, so `SeverityInfo` fell through,
was printed inside `N validation errors:` and made the command exit 1 — for a
candy-version skew the resolver has ALREADY arbitrated deterministically.

Two contracts say that is wrong, both in-tree:
- `sdk/loaderkit/candy_version.go` emits the skew at `DiagInfo` and states: "a
  resolvable skew is INFO, never WARNING … a consumer's zero-warnings gate is for
  unresolved defects and must not fail on a successful arbitration".
- `spec.SeverityError` says it is "the only tier a verdict may turn into a
  non-zero exit".

The verdict now uses the canonical `Diagnostic.IsError()` predicate (which fails
CLOSED on an unknown tier), and info-tier observations are printed as
`notice: …` so they stay actionable instead of only being counted.

Live effect this unblocks: any pin advance that leaves two candies in one box
scope naming different tags of the same repo (the normal shape of a wave). It
blocked a consumer release with:

  charly: error: command "validate": 2 validation errors:
    candy github.com/opencharly/layer-supervisord resolved to multiple git tags …
    candy github.com/opencharly/pod-ollama resolved to multiple git tags …
  (exit status 1)

Regression proof (R7): `TestValidateVerdictDoesNotFailOnInfoTier` is RED before
this change ("must not fail the gate, got: 2 validation errors:") and green after;
`TestValidateVerdictStillFailsOnErrorTier` keeps the error and unknown tiers
failing. Full module suite green.

Refs opencharly/charly#1256

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: ae97a0be417b8f5057cb227fa0fd37c178a46c6d (branch: fix/validate-info-tier)

Change class: plugin logic (one predicate + one print branch, one new test file).

Security screen: PASS — no scope mismatch (diff does exactly what the body claims: verdict now uses Diagnostic.IsError(), info-tier prints as notice:, unknown tier still fails closed per the test), no secrets/network/egress, no guardrail weakening (the change aligns the verdict to the documented spec.SeverityError contract — "only error tier yields non-zero exit" — and the regression test proves error and unknown/empty severities still fail), no supply-chain edits.

Checklist: All applicable rules PASS or NA.

  • R0/R1/R2/R3/R5 — root-caused to the emitter level / severity model / verdict filter; canonical IsError() reused instead of a second ladder; stale == "warning" filter deleted outright.
  • R6/R8/R9 — NA (nothing destructive, no live-service boundary, no charly binary; plugin is go tested).
  • R7/R10 — genuine regression test that is red without the fix (pasted) and green with it; both changed branches (info→notice:, error→collected) execute in the tests.
  • R11 — NA (no design field/shape/kind/mechanism; a severity rule corrected to its documented contract).
  • A1/A3 — body accounts for both files, footer well-formed (*Agent: …* then *Assisted-by: …* last), tier fully tested and validated justified because the changed emitVerdict path executed in a fresh go test build with behavior assertions.
  • Placement: CORRECT — the fix stays in the plugin (candy/plugin-box) layer; no capability pulled into core/sdk.
  • Comments: none (0-comment thread).

Non-blocking note (tool-limited): the end-to-end charly box validate exit-0 observation structurally requires a charly rebuild in the consumer repo; the body honestly discloses this, and the changed mechanism is verified statically via the unit test, so this is not a defect.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 23, 2026 23:35
@github-actions
github-actions Bot merged commit 8cef2ef into main Nov 23, 2026
3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 23, 2026
aitrawog added a commit to opencharly/charly that referenced this pull request Nov 24, 2026
… code change

Round-1 review fixes.

- A3: the tier was `fully tested and validated`, which requires the changed BEHAVIOUR to execute
  against the fresh rebuild. It did not: `box validate` turning an INFO diagnostic into a
  `notice:` line plus exit 0 was never exercised, because three live two-tag fixtures (a project
  naming two tags of one candy — the skew's shape) resolved and validated without the resolver
  emitting any INFO diagnostic (rc=0, zero `notice:` lines). The behavioural proof stays
  opencharly/plugin-box#100's test; what ran here is the resolution, the whole CI go job and the R9
  build. Tier lowered to `analysed on a live system`, per the reviewer's stated ceiling.
- R1/R10: the `check-generated-clean` NOTICE is now RCA'd with a measurement rather than explained
  in prose. Regenerating both generated files with the build's own corpus into a scratch dir: the
  refs table differs by exactly TWO `plugin-distro` rows (`kind:os`, `kind:source`) because
  pluginsgen indexes corpus repos at their DEFAULT BRANCHES, `plugins.go` is byte-identical, and
  `diff | grep -c plugin-box` is 0 for both files — so this pin provably cannot have produced the
  divergence. The residual (the committed index lagging the corpus by those two rows) is filed as
  #1268 under `## Filed issues`.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Nov 24, 2026
…O diagnostics gating a build (#1267)

* fix(deps): pin plugin-box v0.2026327.2335, the release that stops INFO diagnostics gating a build

charly required github.com/opencharly/plugin-box/candy/plugin-box v0.2026326.938, but
opencharly/plugin-box#100 — `charly box validate` exits 0 on an INFO-tier diagnostic instead of
gating the build with exit 1 on an already-arbitrated candy-version skew — shipped as git tag
v2026.327.2335 / module v0.2026327.2335 (8cef2effe), the latest the proxy serves.

Found by checking that every fix from the per-host config session is reachable from a shipped
binary: spec v0.2026328.1115, sdk v0.2026328.1130 and charly v2026.328.1249 were landed and pinned
(#1265); this one was not, so the compiled-in plugin still carried the old
severity rule.

Gate on this tree: the repo's `go` CI job reproduced verbatim — root `go test ./charly/...`
(charly/ 283.3s, pluginsgen 155.0s), the `tools/*` GOWORK=off sweep, `gofmt -l charly tools`
empty, golangci-lint v2.13.2 0 issues over charly/ and all five tools modules — plus the R9
worktree build.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* chore(pr): correct the attribution tier and RCA the build NOTICE — no code change

Round-1 review fixes.

- A3: the tier was `fully tested and validated`, which requires the changed BEHAVIOUR to execute
  against the fresh rebuild. It did not: `box validate` turning an INFO diagnostic into a
  `notice:` line plus exit 0 was never exercised, because three live two-tag fixtures (a project
  naming two tags of one candy — the skew's shape) resolved and validated without the resolver
  emitting any INFO diagnostic (rc=0, zero `notice:` lines). The behavioural proof stays
  opencharly/plugin-box#100's test; what ran here is the resolution, the whole CI go job and the R9
  build. Tier lowered to `analysed on a live system`, per the reviewer's stated ceiling.
- R1/R10: the `check-generated-clean` NOTICE is now RCA'd with a measurement rather than explained
  in prose. Regenerating both generated files with the build's own corpus into a scratch dir: the
  refs table differs by exactly TWO `plugin-distro` rows (`kind:os`, `kind:source`) because
  pluginsgen indexes corpus repos at their DEFAULT BRANCHES, `plugins.go` is byte-identical, and
  `diff | grep -c plugin-box` is 0 for both files — so this pin provably cannot have produced the
  divergence. The residual (the committed index lagging the corpus by those two rows) is filed as
  #1268 under `## Filed issues`.

Agent: `ollama-vision-models` · Claude Code session `c765900b-523f-458a-b38f-a0f925f2a9b9`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant