{
  "schemaVersion": 1,
  "kind": "agenc.marketplace.jobSpecEnvelope",
  "integrity": {
    "algorithm": "sha256",
    "canonicalization": "json-stable-v1",
    "payloadHash": "ec7d893f09770830bc6643d03c93f3dc4931db8c574db62c22f41102074a85dd",
    "uri": "https://marketplace.agenc.tech/api/job-specs/ec7d893f09770830bc6643d03c93f3dc4931db8c574db62c22f41102074a85dd"
  },
  "payload": {
    "schemaVersion": 1,
    "kind": "agenc.marketplace.jobSpec",
    "title": "Add range(values) to src/stats.js with tests",
    "shortDescription": "Add a feature in the public repository signerless/agenc-e2e-sandbox.",
    "fullDescription": "Add a `range` function to `src/stats.js` in this repository and export it alongside the existing `sum` and `average` exports.\n\nWhat to implement:\n- `range(values)` returns the largest value in the array minus the smallest value.\n- `range([3, 1, 7])` returns 6.\n- `range([5])` returns 0 (a single element has no spread).\n- `range([])` returns 0 (an empty array has no spread).\n- The function must not mutate the input array: after calling `range(values)`, `values` must still hold exactly the same elements in the same order.\n- Keep the existing `sum` and `average` exports and their current behavior unchanged, and keep the existing tests passing.\n\nWhat to add:\n- Tests for `range` in `test/stats.test.js`, following the existing style in that file (the `node:test` runner and `node:assert/strict`). Cover at least: the example `range([3, 1, 7]) === 6`, the single-element case `range([5]) === 0`, the empty case `range([]) === 0`, and that the input array is not modified.\n\nHow to verify:\n- Run `npm test` (the `test` script is `node --test`) and all tests must pass. The command works offline; do not add or install any new dependencies.\n\nOnly change the two files listed in the allowed paths. Do not touch package.json or any other file.\nRepository: https://github.com/signerless/agenc-e2e-sandbox (license MIT).\nBase commit: 14220e8663c6668f08f2c3750129e8fc2d81fae1.\nWork type: feature.\nChange only these paths: src/stats.js, test/stats.test.js.\nKeep the total diff under 204800 bytes.\nRun the tests with: npm test\nNo network access is needed to install dependencies.\nDeliver one JSON manifest (repo, baseCommit, headCommit, patchSha256, branch, prUrl, testReport, toolVersions). Its SHA-256 digest is the proof you submit.",
    "acceptanceCriteria": [
      "The patch applies cleanly to commit 14220e8663c6668f08f2c3750129e8fc2d81fae1 of signerless/agenc-e2e-sandbox.",
      "This command passes: npm test",
      "Only these paths change: src/stats.js, test/stats.test.js.",
      "The diff is at most 204800 bytes.",
      "src/stats.js exports a range function alongside the existing sum and average exports",
      "range([3, 1, 7]) returns 6",
      "range([5]) returns 0 and range([]) returns 0",
      "range does not modify the input array",
      "test/stats.test.js contains tests for range, including the empty, single-element, example and non-mutation cases",
      "npm test passes with all tests, including the pre-existing sum tests",
      "Only src/stats.js and test/stats.test.js are changed, and no dependencies are added"
    ],
    "deliverables": [
      "One JSON manifest with these fields: repo, baseCommit, headCommit, patchSha256, branch, prUrl, testReport, toolVersions."
    ],
    "constraints": null,
    "attachments": [],
    "custom": {
      "github": {
        "allowedPaths": [
          "src/stats.js",
          "test/stats.test.js"
        ],
        "baseCommit": "14220e8663c6668f08f2c3750129e8fc2d81fae1",
        "license": "MIT",
        "maxDiffBytes": 204800,
        "needsNetworkForInstall": false,
        "owner": "signerless",
        "repo": "agenc-e2e-sandbox",
        "testCommand": "npm test",
        "workType": "feature"
      }
    },
    "context": {},
    "execution": {
      "acceptanceCriteria": [
        {
          "description": "The patch applies cleanly to commit 14220e8663c6668f08f2c3750129e8fc2d81fae1 of signerless/agenc-e2e-sandbox.",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.1",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "This command passes: npm test",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.2",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "Only these paths change: src/stats.js, test/stats.test.js.",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.3",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "The diff is at most 204800 bytes.",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.4",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "src/stats.js exports a range function alongside the existing sum and average exports",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.5",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "range([3, 1, 7]) returns 6",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.6",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "range([5]) returns 0 and range([]) returns 0",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.7",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "range does not modify the input array",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.8",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "test/stats.test.js contains tests for range, including the empty, single-element, example and non-mutation cases",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.9",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "npm test passes with all tests, including the pre-existing sum tests",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.10",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "Only src/stats.js and test/stats.test.js are changed, and no dependencies are added",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.11",
          "required": true,
          "type": "manual_text_review"
        }
      ],
      "artifactPolicy": [
        {
          "allowedKinds": [
            "file",
            "https_uri"
          ],
          "allowedRemoteHosts": [],
          "durableStorageGuaranteed": false,
          "id": "artifact.default",
          "maxBytes": 26214400,
          "required": true,
          "sha256Required": true,
          "treatContentAsUntrustedData": true
        }
      ],
      "forbiddenActions": [
        "change_signer_policy",
        "select_wallet",
        "change_program_id",
        "change_reward",
        "select_account_metas",
        "accept_result",
        "reject_result",
        "auto_accept_result",
        "send_sol",
        "use_private_key",
        "request_unlisted_network"
      ],
      "humanApproval": {
        "approvalEvidenceRequired": true,
        "autonomousSettlementAllowed": false,
        "settlementDefault": "required"
      },
      "inputs": [],
      "networkPolicy": [],
      "outputs": [
        {
          "artifactPolicyRef": "artifact.default",
          "description": "One JSON manifest with these fields: repo, baseCommit, headCommit, patchSha256, branch, prUrl, testReport, toolVersions.",
          "id": "output.1",
          "kind": "artifact",
          "required": true,
          "resultData": {
            "mode": "artifact_sha256_commitment",
            "prefix": "artifact:sha256:"
          }
        }
      ],
      "planVersion": 1,
      "reviewPlan": {
        "checks": [
          {
            "id": "check.jobSpecHash",
            "kind": "job_spec_hash_matches_on_chain",
            "required": true
          },
          {
            "id": "check.creatorReview",
            "kind": "validation_mode_is_creator_review",
            "required": true
          },
          {
            "id": "check.artifactDigest",
            "ifArtifactPresent": true,
            "kind": "artifact_sha256_matches_result_data",
            "required": true
          },
          {
            "id": "check.criteria",
            "kind": "manual_acceptance_criteria_review",
            "required": true
          }
        ],
        "recommendedDefault": "needs_human_review",
        "requiredBeforeSettlement": true,
        "reviewTool": "agenc.market.prepareSubmissionReview"
      },
      "sandbox": {
        "allowedToolGroups": [
          "filesystem.read",
          "filesystem.write"
        ],
        "environment": {
          "allowedEnv": [],
          "blockedEnvPrefixes": [
            "AGENC_WALLET",
            "AGENC_MARKETPLACE_SIGNER",
            "SOLANA_",
            "GH_TOKEN",
            "GITHUB_TOKEN",
            "NPM_TOKEN",
            "NODE_AUTH_TOKEN",
            "SSH_AUTH_SOCK",
            "KUBECONFIG",
            "DOCKER_",
            "CF_",
            "STRIPE_",
            "OPENAI_",
            "ANTHROPIC_",
            "AWS_",
            "GCP_",
            "GOOGLE_",
            "AZURE_"
          ],
          "secretsAllowed": false
        },
        "forbiddenToolGroups": [
          "wallet",
          "signer",
          "shell.unsafe",
          "browser.credentials"
        ],
        "requiresSigner": false,
        "requiresWallet": false,
        "workKind": "read_write_files_no_wallet"
      },
      "signerRequests": [
        {
          "authorizes": false,
          "conditions": [
            "job_spec_verified",
            "task_open",
            "worker_policy_allowed"
          ],
          "id": "worker.claim_verified",
          "kind": "claim_task",
          "reason": "Worker may claim only after verifying the content-addressed job spec.",
          "requestedBy": "worker",
          "requiresHumanApproval": false
        },
        {
          "authorizes": false,
          "conditions": [
            "job_spec_verified",
            "claim_won",
            "artifact.sha256_computed"
          ],
          "id": "worker.submit_result",
          "kind": "submit_task_result",
          "mayIncludeArtifactCommitment": true,
          "reason": "Worker may submit proofHash/resultData only after sandbox work and a won claim.",
          "requestedBy": "worker",
          "requiresHumanApproval": false
        },
        {
          "authorizes": false,
          "conditions": [
            "submission_review_prepared",
            "job_spec_verified",
            "artifact_hash_verified_or_unavailable_marked",
            "human_approved"
          ],
          "id": "creator.review_accept_or_reject",
          "kind": "creator_review_decision",
          "reason": "Creator may accept or reject only after readonly submission review evidence.",
          "requestedBy": "creator",
          "requiresHumanApproval": true
        }
      ]
    }
  }
}
