CtrlK
BlogDocsLog inGet started
Tessl Logo

martinfrancois/java-optionals

Help AI coding agents use Java Optional well in new code and cleanups, without replacing one antipattern with another.

100

2.08x
Quality

100%

Does it follow best practices?

Impact

100%

2.08x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-3/

{
  "context": "Transcript-derived cleanup: remove Optional presence-read patterns while preserving checked prompt and parser behavior.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Compiles and creates requested artifact",
      "description": "Creates a coherent StoreSetup.java with the requested class, constructor, interfaces, records, method signatures, imports, and Java 25-compatible code.",
      "max_score": 2
    },
    {
      "name": "Preserves warehouse selection behavior",
      "description": "Returns a matching configured warehouse when present, throws the same setup_warehouse_required missing-id exception and message when absent from the manifest, auto-selects a single warehouse, preserves non-interactive behavior, and prompts only when needed.",
      "max_score": 2
    },
    {
      "name": "Preserves workspace selection behavior",
      "description": "Returns a configured workspace id without inspecting workspaces, auto-selects exactly one workspace with the same info message, preserves empty and non-interactive exceptions, and preserves interactive prompt behavior.",
      "max_score": 2
    },
    {
      "name": "Preserves port and YAML behavior",
      "description": "Validates requested ports before returning them, scans fallback ports only when absent, preserves port exceptions, returns Optional.empty() for absent front matter, parses present text with yaml.readValue(...), and keeps IOException visible.",
      "max_score": 3
    },
    {
      "name": "Uses direct Optional boundaries for ordinary values",
      "description": "Uses value-binding Optional flow such as map(...).orElseGet(...) for ordinary non-checked branches like serverPort, without duplicate lookup work. Do not require map(...).orElseGet(...) at checked IO, prompt, or checked-parser boundaries where Java checked-exception rules make a narrow explicit branch clearer.",
      "max_score": 18
    },
    {
      "name": "Handles checked boundaries without generic Optional helpers",
      "description": "Keeps checked prompt/parser boundaries readable without introducing OptionalSupport, OptionalValues, OptionalBoundaries, CheckedOptionals, throwing suppliers/functions, mapThrowing, or orElseGetThrowing helpers. Award full credit for a narrow checked-boundary empty guard followed by one local present-value read, such as `if (value.isEmpty()) { ...checked branch... } return value.get();`.",
      "max_score": 12
    },
    {
      "name": "Avoids replacement Optional antipatterns",
      "description": "Does not use isPresent()/isEmpty() followed by get()/orElseThrow() for ordinary value flow, orElse(null) for local control flow, Optional.stream().toList(), stream()::iterator, optionalValues, presentValues, loops over one Optional, or other fake one-Optional iterable workarounds. Do not penalize a single local get() after an empty guard when it is limited to a real checked IO, prompt, or checked-parser boundary and avoids those replacement workarounds.",
      "max_score": 18
    },
    {
      "name": "Keeps cleanup focused",
      "description": "Keeps the cleanup focused on the requested Optional value-flow problems without unrelated abstractions, dependency changes, or broad rewrites.",
      "max_score": 3
    }
  ]
}

README.md

tile.json