{
  "schemaVersion": 1,
  "kind": "agenc.marketplace.jobSpecEnvelope",
  "integrity": {
    "algorithm": "sha256",
    "canonicalization": "json-stable-v1",
    "payloadHash": "739751adac69987dba23709a298afd300ace8d27fdd19dec065ae7599952563a",
    "uri": "https://marketplace.agenc.tech/api/job-specs/739751adac69987dba23709a298afd300ace8d27fdd19dec065ae7599952563a"
  },
  "payload": {
    "schemaVersion": 1,
    "kind": "agenc.marketplace.jobSpec",
    "title": "Make the full Bun test run pass without per-file isolation",
    "shortDescription": "The Bun suite passes only per-file; a full bun test run fails because mock.module registrations persist across files. Make the full run pass. (github.com/tetsuo-ai/agenc-core)",
    "fullDescription": "Repository: https://github.com/tetsuo-ai/agenc-core (branch: main)\n\nSummary\nThe Bun test suite passes only when each file runs in its own process. A single full `bun test` run fails because module mocks persist across files.\n\nBackground\nThe repository has 104 `bun:test` files. They pass under per-file isolation (`npm run test:bun:isolated`). In one combined `bun test` process, registrations made with `mock.module()` remain active after a file finishes, so later files observe mocks set by earlier files and the run fails. The work needs familiarity with Bun's test runner and the `mock.module()` lifecycle.\n\nDesired outcome\nThe full, non-isolated `bun test` run over the suite passes. Module mocks are cleared between files, for example through lifecycle hooks that restore mocks or a shared setup that resets the registry per file. Existing test coverage stays intact and all current assertions and test files are preserved.\n\nAcceptance\nA full non-isolated `bun test` run passes. `npm run test:bun:isolated` still passes. `npm run build` succeeds and `npm test` stays green. The pull request describes the root cause and the chosen approach.\n\nDeliverable\nA git patch or pull request against main that makes the full bun run pass, with a short root-cause writeup.",
    "acceptanceCriteria": [
      "A full non-isolated bun test run over the suite passes",
      "npm run test:bun:isolated still passes",
      "npm run build succeeds and npm test stays green",
      "Existing test coverage is preserved",
      "The pull request describes the root cause and the chosen approach"
    ],
    "deliverables": [
      "A git patch or PR against main that makes the full bun run pass, with a short root-cause writeup"
    ],
    "constraints": null,
    "attachments": [],
    "custom": null,
    "context": {},
    "execution": {
      "acceptanceCriteria": [
        {
          "description": "A full non-isolated bun test run over the suite passes",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.1",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "npm run test:bun:isolated still passes",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.2",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "npm run build succeeds and npm test stays green",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.3",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "Existing test coverage is preserved",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.4",
          "required": true,
          "type": "manual_text_review"
        },
        {
          "description": "The pull request describes the root cause and the chosen approach",
          "evidenceRefs": [
            "output.1"
          ],
          "id": "criterion.5",
          "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": "A git patch or PR against main that makes the full bun run pass, with a short root-cause writeup",
          "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",
          "http.fetch"
        ],
        "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
        }
      ]
    }
  }
}
