{
  "proofEvidence": {
    "statement": "Specs.HeadContract.accepted",
    "assumptionsPolicy": "https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/.github/assumptions-allowlist.txt",
    "registry": "https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/.github/targets.json",
    "status": "replayed",
    "replay": {
      "contract": "https://github.com/bloom-directory/lefttoprove/blob/3440f400d235544fe816475adde8e55009e057c0/targets/head/Contract.v",
      "revision": "3440f400d235544fe816475adde8e55009e057c0",
      "checkedAt": "2026-12-01T17:27:44.000Z",
      "run": "https://github.com/bloom-directory/lefttoprove/actions/runs/46701031785",
      "bundle": "https://github.com/bloom-directory/lefttoprove/actions/runs/46701031785#artifacts"
    }
  },
  "target": "head",
  "scope": {
    "status": "scoped",
    "invocation": "head -n N",
    "inputDomain": "Read a finite byte stream from stdin. N is a nonnegative integer in a documented range.",
    "proofObligation": "Output all bytes through the Nth LF, or the whole input if there are fewer than N LF bytes. For N = 0, produce empty output. Show that the result is independent of read chunk boundaries.",
    "excluded": "Named files, negative counts, GNU byte mode, and guarantees about unread bytes on a shared descriptor."
  },
  "obligations": [
    {
      "id": "head.lines",
      "target": "head",
      "title": "Line prefix",
      "summary": "Read the bounded line count from argv and emit the requested stdin prefix under the successful byte I/O model.",
      "status": "proved",
      "statement": "HeadContract.lines",
      "proof": {
        "source": "https://github.com/bloom-directory/lefttoprove/blob/1d8af2c5cde11163204be6dd05ed2c6b96bc47dc/targets/head/Head.v",
        "pullRequest": "https://github.com/bloom-directory/lefttoprove/pull/12",
        "contributor": "josh-richardson",
        "mergedAt": "2026-12-01T08:17:43Z"
      },
      "requires": [
        "root.io"
      ],
      "unblocks": 1,
      "recommended": false,
      "page": "/utilities/head/#head.lines"
    }
  ],
  "requires": [
    {
      "id": "root.io",
      "target": "root",
      "title": "Byte I/O and argument forwarding",
      "summary": "read_byte, write_byte, arg_count and arg_byte forward to the host adapter and return its results unchanged.",
      "status": "proved",
      "statement": "RootContract.io",
      "proof": {
        "source": "https://github.com/bloom-directory/lefttoprove/blob/1d8af2c5cde11163204be6dd05ed2c6b96bc47dc/targets/root/Root.v",
        "pullRequest": "https://github.com/bloom-directory/lefttoprove/pull/8",
        "contributor": "josh-richardson",
        "mergedAt": "2026-12-01T08:17:43Z"
      },
      "requires": [],
      "unblocks": 44,
      "recommended": false,
      "page": "/utilities/root/#root.io"
    },
    {
      "id": "root.exit",
      "target": "root",
      "title": "Exit status",
      "summary": "exit forwards a command's status to the host adapter unchanged, for every i32 status, and returns or traps as the adapter does.",
      "status": "tested",
      "statement": "RootContract.exit",
      "proof": null,
      "requires": [],
      "unblocks": 4,
      "recommended": false,
      "page": "/utilities/root/#root.exit"
    }
  ],
  "reference": {
    "name": "GNU Coreutils",
    "version": "9.11",
    "release": "https://github.com/coreutils/coreutils/releases/tag/v9.11",
    "manual": "https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html",
    "source": "https://github.com/coreutils/coreutils/blob/v9.11/src/head.c"
  },
  "specification": "https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/SPEC.md",
  "rocq": {
    "statement": "HeadContract.accepted",
    "source": "https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/Contract.v",
    "checkSpecification": [
      "./ltp check head"
    ]
  },
  "fixtures": {
    "cases": "Zero lines, empty input, a final unterminated line, consecutive empty lines, and an LF on the edge of a read buffer.",
    "data": [
      {
        "name": "two-line prefix",
        "args": [
          "-n",
          "2"
        ],
        "stdinHex": "610a620a63",
        "stdoutHex": "610a620a",
        "exitStatus": 0
      },
      {
        "name": "zero lines with GNU head",
        "args": [
          "-n",
          "0"
        ],
        "stdinHex": "610a",
        "stdoutHex": "",
        "exitStatus": 0
      }
    ],
    "source": "https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/fixtures.json"
  },
  "submission": {
    "url": "https://github.com/bloom-directory/lefttoprove/compare",
    "metadata": [
      "Target: head",
      "Contribution: proof"
    ],
    "replay": "sh targets/head/verify.sh",
    "existingVerifier": {
      "source": "https://github.com/bloom-directory/lefttoprove/blob/main/targets/head/verify.sh",
      "instruction": "Replay the current head milestone in the checker image, which sets WASMCERT. See SET UP THE CHECKER in https://lefttoprove.com/join.txt."
    }
  }
}
