{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xavidop.github.io/kojo/schema/goals.schema.json",
  "$ref": "#/$defs/Goals",
  "$defs": {
    "Check": {
      "properties": {
        "name": {
          "type": "string"
        },
        "run": {
          "type": "string",
          "description": "Run is a shell command. ${NAME} expands to a skill input or output."
        },
        "timeout": {
          "type": "string",
          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
          "description": "Timeout bounds the command. Default 10m."
        },
        "expect_failure": {
          "type": "boolean",
          "description": "ExpectFailure inverts the check: the command must exit non-zero (a\nreproduction test must fail before the fix)."
        },
        "skip_if_unset": {
          "type": "boolean",
          "description": "SkipIfUnset skips the check while one of the ${NAME}s it uses has no\nvalue, instead of failing it."
        },
        "on_base": {
          "type": "boolean",
          "description": "OnBase runs the check on the code from before the pull request, with\nthe session's changes on top: the files the pull request changed and\nthe session did not are put back at the merge base for the run. A\nsession without a pull request reports it skipped."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Check is one deterministic check."
    },
    "Constraints": {
      "properties": {
        "max_changed_lines": {
          "type": "integer",
          "description": "MaxChangedLines caps added plus removed lines. Zero means no cap."
        },
        "forbidden_paths": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "ForbiddenPaths are globs the skill must not change."
        },
        "required_paths": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "RequiredPaths are globs of which at least one file must change."
        },
        "allowed_paths": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "AllowedPaths are globs every changed path must match, or @tests for\ntest files (internal/testpaths). A deletion and both sides of a rename\ncount. An entry whose ${NAME} has no value matches nothing."
        },
        "no_changes": {
          "type": "boolean",
          "description": "NoChanges requires the workspace to be left untouched (reviews)."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Constraints bound the diff a skill may produce."
    },
    "Goals": {
      "properties": {
        "max_attempts": {
          "type": "integer",
          "description": "MaxAttempts is how many times the subagent may try. Default 3."
        },
        "checks": {
          "items": {
            "$ref": "#/$defs/Check"
          },
          "type": "array",
          "description": "Checks are commands that must exit 0, run in order in the sandbox."
        },
        "constraints": {
          "$ref": "#/$defs/Constraints"
        },
        "judge": {
          "$ref": "#/$defs/Judge",
          "description": "Judge is the rubric a model grades the result against, after the\ndeterministic checks passed."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Goals is goals.yaml: the acceptance criteria the goal critic enforces."
    },
    "Judge": {
      "properties": {
        "rubric": {
          "type": "string"
        },
        "model_tier": {
          "type": "string",
          "description": "ModelTier is the tier of the judge. Default strong."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Judge is the rubric-based check."
    }
  },
  "title": ".factory/skills/\u003cname\u003e/goals.yaml: acceptance criteria"
}
