mmz 0.14.1

memoized command runner
Documentation
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/mlavrinenko/mmz/main/schema/status.schema.json",
  "title": "mmz status",
  "description": "Output of `mmz --status=json`: each rule's freshness against its cache.",
  "type": "object",
  "additionalProperties": false,
  "required": ["manifest", "rules"],
  "properties": {
    "manifest": {
      "type": "string",
      "description": "Path of the manifest governing the working directory."
    },
    "probes": {
      "type": "object",
      "description": "Each probe mmz resolved for this report, name to the lowercase hex blake3 of its stdout — what mmz actually saw. A declared probe that no reported rule names in its inputs is never run, so it is absent here. Absent entirely when the report named none.",
      "additionalProperties": { "type": "string" }
    },
    "rules": {
      "type": "array",
      "description": "One entry per command rule, in manifest order.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "source", "state", "inputs"],
        "properties": {
          "name": {
            "type": "string",
            "description": "The rule's name (matcher and cache identity)."
          },
          "source": {
            "type": "string",
            "description": "The file that declared this rule: project-root-relative when it is under the project root, absolute otherwise (so a fragment outside the project, a Nix store path say, stays recognisable). Present for every rule, including in a single-file project with no `imports:` — the root manifest is the source of its own rules, not a special case."
          },
          "state": {
            "type": "string",
            "description": "Freshness verdict. `fresh`: cache hit. `stale`: inputs changed — a file, or a probe whose stdout moved. `never`: no record yet. `failed`: last run failed, so it re-runs. `no-inputs`: the rule resolves to zero files and names no probe. `missing-output`: a declared output is gone, so the record is void whatever the inputs hash — it outranks `stale`, since an input change is the assumption a reader already holds. `expired`: nothing moved, but the pass is at least the rule's `ttl` old, so it re-runs; every other non-fresh state outranks it.",
            "enum": ["fresh", "stale", "never", "failed", "no-inputs", "missing-output", "expired"]
          },
          "digest": {
            "type": "string",
            "description": "Digest of the current inputs — its resolved files folded with the digest of every probe it names. Absent when the rule resolves to no files and names no probe."
          },
          "missing_output": {
            "type": "string",
            "description": "The declared output that voided the record, as the manifest spells it (the first one missing, in declaration order). Present exactly when state is `missing-output`."
          },
          "ttl": {
            "type": "string",
            "description": "The rule's declared `ttl`, as the manifest spells it. Absent when the rule declares none."
          },
          "expires_at": {
            "type": "integer",
            "minimum": 0,
            "description": "Unix seconds at which the recorded pass stops being fresh: `cached.ran_at` plus the ttl. At or after it the state is `expired` (unless something outranks it). Present when the rule declares a `ttl` and its record succeeded."
          },
          "cached": {
            "type": "object",
            "additionalProperties": false,
            "required": ["digest", "ok", "ran_at"],
            "description": "The stored record. Absent when the rule has never run.",
            "properties": {
              "digest": {
                "type": "string",
                "description": "Input digest recorded at the last run."
              },
              "ok": {
                "type": "boolean",
                "description": "Whether the recorded run succeeded."
              },
              "ran_at": {
                "type": "integer",
                "minimum": 0,
                "description": "Unix seconds when the record was written."
              },
              "outputs": {
                "type": "array",
                "description": "The outputs the rule declared when this run was recorded, so a missing one is reported against the run that promised it. Absent when the rule declared none.",
                "items": { "type": "string" }
              },
              "probes": {
                "type": "object",
                "description": "The digest each named probe produced when this run was recorded, so it can be diffed against the report's top-level `probes` — which is how a stale verdict names the probe that moved rather than sending a reader to diff files that did not. Absent when the rule named none.",
                "additionalProperties": { "type": "string" }
              }
            }
          },
          "inputs": {
            "type": "array",
            "description": "Resolved inputs with content hashes, sorted by path.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["path", "hash"],
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Path relative to the manifest root, forward slashes."
                },
                "hash": {
                  "type": "string",
                  "description": "Lowercase hex blake3 of the file's contents."
                }
              }
            }
          }
        }
      }
    }
  }
}