Class TaskResultValidator

java.lang.Object
neqsim.util.agentic.TaskResultValidator
All Implemented Interfaces:
Serializable

public final class TaskResultValidator extends Object implements Serializable
Validates task results.json files against the expected schema for NeqSim task-solving workflows.

The task-solving workflow (see docs/development/TASK_SOLVING_GUIDE.md) produces a results.json file at the end of each analysis notebook. This validator checks that the JSON conforms to the expected schema, ensuring downstream report generators and cross-session learning systems can reliably consume the output.

Required Keys:

  • key_results — Main numerical outputs with unit suffixes
  • validation — Acceptance criteria check outcomes
  • approach — Brief description of method used
  • conclusions — Summary of findings
  • figure_captions — Map of filename to caption string
  • figure_discussion — Array of discussion objects per figure
  • equations — LaTeX equations for the report
  • tables — Tabular data for the report
  • references — Cited literature
  • uncertainty — Monte Carlo P10/P50/P90 results
  • risk_evaluation — Risk register with mitigation
  • benchmark_validation — External data comparison
  • standards_applied — Industry standards used with compliance status

Usage:


String json = new String(Files.readAllBytes(Paths.get("results.json")));
TaskResultValidator.ValidationReport report = TaskResultValidator.validate(json);
if (!report.isValid()) {
  System.out.println(report.toJson());
}

Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • REQUIRED_KEYS

      private static final List<String> REQUIRED_KEYS
  • Constructor Details

    • TaskResultValidator

      private TaskResultValidator()
  • Method Details

    • validate

      public static TaskResultValidator.ValidationReport validate(String jsonString)
      Validate a results.json string against the expected schema.
      Parameters:
      jsonString - the JSON string to validate
      Returns:
      validation report with errors and warnings
    • validateKeyResults

      private static void validateKeyResults(com.google.gson.JsonObject keyResults, TaskResultValidator.ValidationReport report)
      Validate the key_results section.
      Parameters:
      keyResults - the key_results object
      report - validation report to append to
    • validateValidationSection

      private static void validateValidationSection(com.google.gson.JsonObject validation, TaskResultValidator.ValidationReport report)
      Validate the validation section.
      Parameters:
      validation - the validation object
      report - validation report to append to
    • validateUncertaintySection

      private static void validateUncertaintySection(com.google.gson.JsonElement uncertainty, TaskResultValidator.ValidationReport report)
      Validate the uncertainty section.
      Parameters:
      uncertainty - the uncertainty element
      report - validation report to append to
    • validateRiskEvaluation

      private static void validateRiskEvaluation(com.google.gson.JsonElement riskEval, TaskResultValidator.ValidationReport report)
      Validate the risk_evaluation section.
      Parameters:
      riskEval - the risk_evaluation element
      report - validation report to append to
    • validateFigureDiscussion

      private static void validateFigureDiscussion(com.google.gson.JsonElement figDisc, TaskResultValidator.ValidationReport report)
      Validate the figure_discussion section.
      Parameters:
      figDisc - the figure_discussion element
      report - validation report to append to
    • validateStandardsApplied

      private static void validateStandardsApplied(com.google.gson.JsonElement standardsElem, TaskResultValidator.ValidationReport report)
      Validate the standards_applied section.

      Each entry should have: code, version, scope, and status (PASS/FAIL/INFO). Optional fields: design_value, limit, unit.

      Parameters:
      standardsElem - the standards_applied element
      report - validation report to append to