{"record":{"id":"5a1f38b8e906d53d","repo":"wagoodman/dive","slug":"failed-evaluation","errorCode":null,"errorMessage":"failed evaluation","messagePattern":"failed evaluation","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/command/adapter/evaluator.go","lineNumber":44,"sourceCode":"\nfunc (c evaluationActionObserver) Evaluate(ctx context.Context, analysis *image.Analysis) ci.Evaluation {\n\tlog.WithFields(\"image\", analysis.Image).Infof(\"evaluating image\")\n\tmon := bus.StartTask(payload.GenericTask{\n\t\tTitle: payload.Title{\n\t\t\tDefault:      \"Evaluating image\",\n\t\t\tWhileRunning: \"Evaluating image\",\n\t\t\tOnSuccess:    \"Evaluated image\",\n\t\t},\n\t\tHideOnSuccess:      false,\n\t\tHideStageOnSuccess: false,\n\t\tID:                 analysis.Image,\n\t\tContext:            fmt.Sprintf(\"[rules: %d]\", len(c.Rules)),\n\t})\n\teval := c.Evaluator.Evaluate(ctx, analysis)\n\tif eval.Pass {\n\t\tmon.SetCompleted()\n\t} else {\n\t\tmon.SetError(fmt.Errorf(\"failed evaluation\"))\n\t}\n\tbus.Report(eval.Report)\n\treturn eval\n}\n","sourceCodeStart":26,"sourceCodeEnd":49,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/command/adapter/evaluator.go#L26-L49","documentation":"Set on the progress monitor (mon.SetError) when the rule evaluator concludes eval.Pass == false. Unlike error [0] (which turns this into a process exit code), this one only marks the 'Evaluating image' task as failed in the terminal task list — the full eval report is still emitted via bus.Report and the eval result is returned to the caller. It represents the same condition: one or more CI rules failed against the analysis.","triggerScenarios":"adapter.NewEvaluator(rules).Evaluate(ctx, analysis) running under --ci with at least one rule (lowestEfficiencyThreshold, highestWastedBytes, highestUserWastedPercent) evaluating to RuleFailed against the analyzed image.","commonSituations":"CI pipelines gating image builds on size/efficiency; a base-image update (e.g. new ubuntu tag) suddenly pushes wasted bytes over the configured threshold without any Dockerfile change.","solutions":["Inspect the printed evaluation report to identify the failing rule and margin","Reduce wasted space in the image (combine add/remove layers, clean package caches)","Adjust or disable the offending rule in the CI rules config","If the failure is marginal and acceptable, document a new threshold and commit the config change alongside the image change"],"exampleFix":"# .dive-ci\n# before\nrules:\n  lowestEfficiencyThreshold: 0.9\n  highestWastedBytes: 1MB\n\n# after (realistic for the current image)\nrules:\n  lowestEfficiencyThreshold: 0.8\n  highestWastedBytes: 50MB","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"eval := adapter.NewEvaluator(rules).Evaluate(ctx, analysis)\nif !eval.Pass {\n    for _, r := range eval.Report {\n        // log rule key + expected/actual for actionable CI output\n    }\n    return errors.New(\"failed evaluation\")\n}","preventionTips":["Log each rule's pass/fail margin, not just the aggregate result","Baseline thresholds against current images before enabling the gate","Pin the CI config next to the Dockerfile so both change together"],"tags":["ci","rules","monitor","evaluation"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}