{
  "commit": "03dc2d5a727b1195ec82857a98506f632529e280",
  "lens": "none: adversarial whole-contract pass",
  "verdict": "findings",
  "counts": {
    "high": 1,
    "medium": 0,
    "low": 0,
    "info": 0
  },
  "findings": [
    {
      "id": "none-1",
      "severity": "high",
      "title": "A successful callback with an unprovable job ID permanently blocks queued rounds",
      "where": "src/Changeme.sol: onResult, proveJob, _head, retry, skip",
      "scenario": [
        "Deploy Changeme on chain 1 and contribute at least the live job.open price. This sends round 1 and opens round 2.",
        "Contribute at least the live job.continue price into round 2 while attempt 1 is pending.",
        "The Intake calls onResult for attempt 1 with a resultHash matching a successful result document that lacks a lowercase UUID top-level jobId, for example {\"status\":\"built\"}.",
        "onResult marks attempt 1 Succeeded, clears activeAttempt, increments versionCount, and leaves round 2's pool queued. proveJob rejects the document.",
        "After sentAt + 1 day, dispatch returns false because head() is NeedsProof. retry reverts HeadNeedsProof before any payment or recovery check; skip reverts NothingToRecover because activeAttempt is zero. No state transition can progress the queued round."
      ],
      "impact": "A success-shaped but unparseable/missing-jobId result permanently freezes all later pooled rebuilds. The path has no active attempt for the one-day recovery mechanism to retry or skip. This violates the no-permanent-freeze rule.",
      "proof": "Own test: test/lifecycle/FullRoundProbe.t.sol::testFinding_SuccessWithoutJobIdPermanentlyBlocksRecovery, run against test/doubles. It passed (gas 2,455,492), asserting BadResultDocument from proveJob, HeadNeedsProof from retry after a day, NothingToRecover from skip, and unchanged queued pool/no active attempt. Relevant code: onResult sets Succeeded and activeAttempt=0; _head returns NeedsProof when jobId is empty; retry immediately reverts in that mode; skip requires a nonzero activeAttempt.",
      "fix": "Add a one-day escape for NeedsProof that permits a caller-funded retry using a caller-supplied current project head (and the live quote), while retaining the prior successful version record. The changed retry/head path is estimated at about 100-200 runtime bytes; Changeme has only 214 bytes of reported runtime margin, so reclaim code elsewhere or measure/refactor to stay below 24,576 bytes.",
      "liveOnly": false
    }
  ],
  "checked": [
    "Pinned source checkout: HEAD equals 03dc2d5a727b1195ec82857a98506f632529e280.",
    "Contribution ordering, one receipt per wish, minimum amount, wish validation, 50-wish limit, quote threshold, surplus carry and exact payer pull: suite passed; contributions while a build is active enter the next round.",
    "Interleaved pooled contributions and sponsors, success/failure/refusal callbacks, stale callbacks, delayed retry and skip, failed-open and failed-continuation recovery: suite passed; original round wishes remain archived and contributors are not debited again for sponsored retries.",
    "Initial job.open, proven job.continue parent, admission refusal with a proven parent, and unknown-head caller-funded recovery: suite passed. Incorrect externally supplied parent remains a sponsor-paid admission risk, as described by the design.",
    "Live quote reads, per-call maxPrice, chain ID restriction, exact IMD allowance and zero allowance after Intake pull: binding and lifecycle suites passed against doubles.",
    "Callbacks are Intake-only and request-ID mapped; success/failure settlement and late callbacks are covered. Test double stipend is 200,000 gas; the callback gas tests passed.",
    "Round/version archive reads connect round wishes and receipt IDs, attempts, request IDs, result hashes and proven job IDs. RoundBuilt emits the result URI; every version can be enumerated by version(v).",
    "Order encoding and hostile wish escaping: suite passed, including maximum escaped batch within the 16,384-byte body bound.",
    "Full controller stress probe: a round with 50 maximum-length, quote-heavy wishes sent on the last contribution when that call had 20,000,000 gas available. The equivalent probe reverted with 10,000,000, 15,000,000 and 19,000,000 gas caps; no exact gas figure was established.",
    "ERC-721 metadata, transfer attribution, supply behavior, no owner surface and receipt rendering tests passed.",
    "Foundry size report: Changeme runtime is 24,362 bytes, with 214 bytes under the 24,576-byte limit."
  ],
  "commands": [
    {
      "command": "git clone https://github.com/identity-md-launches/goal-3599-have-swarm-build-test.git test/scratch/repo && git -C test/scratch/repo checkout --detach 03dc2d5a727b1195ec82857a98506f632529e280",
      "ended": "success; detached HEAD at the requested commit"
    },
    {
      "command": "forge test --offline --match-path 'test/**/*.t.sol'",
      "ended": "success; 7 suites, 88 passed, 0 failed"
    },
    {
      "command": "forge build --offline --sizes",
      "ended": "success; Changeme runtime size 24,362 bytes"
    },
    {
      "command": "forge test --offline --match-path test/lifecycle/FullRoundProbe.t.sol --match-test testFinding -vv",
      "ended": "success; own permanent-freeze proof passed"
    },
    {
      "command": "forge test --offline --match-path test/lifecycle/FullRoundProbe.t.sol -vv (worst-case 50-wish send with 20,000,000 gas cap)",
      "ended": "success; full round sent on contribution 50"
    },
    {
      "command": "forge test --offline --match-path test/lifecycle/FullRoundProbe.t.sol (same probe with 10,000,000, 15,000,000 and 19,000,000 gas caps)",
      "ended": "each run reverted at its selected gas cap; probe not evidence of an exact intrinsic gas figure"
    }
  ]
}
