{
  "area": "PEPE RUN backend durability and independent replay verification",
  "sourcePins": {
    "goalRepository": {
      "url": "https://github.com/identity-md-launches/goal-3513-continue-complete-existing-pepe",
      "commit": "0e222f40d058f0462c1ec6418e987211950998fc"
    },
    "websiteRepository": {
      "url": "https://github.com/identity-md-launches/launch-3521-publish-free-play-pepe-run",
      "commit": "f74a1295e5d9c5b0948253fded6eedbc7d13aa05"
    },
    "observationDate": "2026-11-28",
    "scope": "Read-only inspection and disposable offline reproductions. No RPC calls, deployment, transaction, service provisioning, production writes, or publishing were performed."
  },
  "evidence": [
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:src/RunArcade.sol:L293-L354; src/RunVerifier.sol:L56-L97",
      "observation": "A paid score can be relayed by any caller only after the immutable arcade accepts two distinct configured EIP-712 signer signatures before epoch end; ranking is on-chain and settlement is permissionless."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:services/main/application.mjs:L34-L63,L302-L320,L360-L371; services/settlement/application.mjs:L35-L70",
      "observation": "The assembled application constructs a settlement worker and route handler, but its public wrapper rejects every non-GET request before forwarding settlement routes; the handler implements relay only as POST."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:services/verifier/replay.mjs:L44-L133; services/verifier/witness.mjs:L18-L128; services/verifier/service.mjs:L25-L118",
      "observation": "Replay verification independently fetches the entry/finality evidence, recomputes the witness input chain and replays from a trusted seed rather than a checkpoint. Witness append/seal writes use SQLite WAL, FULL synchronous mode and IMMEDIATE transactions."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:backend/store/migrations/001.sql:L2-L87; migrations/003.sql:L1-L66; backend/store/score-reservations.mjs:L8-L72",
      "observation": "Purchase log coordinates, one session per purchase, input sequence, per-role score reservations and attestations have SQL primary/unique constraints; score reservation uses a role-owned SQLite journal and persist-or-compare transaction."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:services/main/config.mjs:L7-L75; services/main/operator.mjs:L4-L46; backend/runtime/README.md:L24-L31,L76-L86",
      "observation": "Production protection, custody, recovery, approval, eligibility, relay and peer services are required configuration/adapters. The code does not itself establish their independence, encrypted volumes, backup retention, or restore operation."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:test/audit-system/attacks/score-path.test.mjs:L23-L94; services/verifier/check.mjs:L224-L342",
      "observation": "Targeted tests reject altered terminal/seed/input evidence and conflicting signer records, but intentionally accept a real-time bot transcript and state that colluding signer operators are not eliminated."
    },
    {
      "ref": "f74a1295e5d9c5b0948253fded6eedbc7d13aa05:deployments/chain-1.json:L1-L34; dist/index.html:L7-L8,L98-L103; README.md:L1-L9",
      "observation": "The pinned website revision has null deployed contracts/roles and an empty API meta setting; its paid controls are disabled and its README calls the build unpublished with paid play closed."
    },
    {
      "ref": "0e222f40d058f0462c1ec6418e987211950998fc:docs/audit/triage/index.json; docs/audit/triage/ledger.md:L10-L39",
      "observation": "Historical triage retains F-01/F-02 and SR-01 through SR-04 as open. This is a historical project claim, not independent proof of a live deployment."
    }
  ],
  "endToEndTrace": {
    "status": "observed code path only; no deployed paid run exists in either pinned revision",
    "steps": [
      "Admission creates a chain-1 EIP-712 quote; RunArcade.purchase verifies it, consumes the wallet nonce, creates the entry and records wallet, epoch, Royal snapshot, entry block, commitment and rules hash (backend/admission/index.mjs; src/RunArcade.sol:L204-L255).",
      "The indexer must register a finalized purchase/admission use. Runtime resolves that canonical entry and finalized entryBlock+2 seed block before opening the sealed admission seed (services/main/application.mjs:L223-L243; backend/admission/README.md).",
      "API start owns the entry and asks the independent witness to open tick 0; failure disconnects the run. Inputs flow runtime durable stage -> witness durable ACK -> local receipt -> client ACK (services/api/index.mjs:L101-L155; backend/runtime/check.mjs output).",
      "At terminal state, the witness seals its own input root. The runtime exports authenticated terminal evidence only to verifier peers; replay inputs are unavailable from the witness while live (services/verifier/witness.mjs:L105-L141; services/verifier/service.mjs:L132-L153).",
      "Each role independently runs verifyTerminal: chain entry/finality, commitment opening, witnessed events, terminal root, fresh engine replay, Royal use, replay digest and deadline are compared (services/verifier/replay.mjs:L54-L133).",
      "Each role reserves one immutable digest/root before remote-KMS signing; score authority additionally verifies replay-verifier public evidence. RunVerifier then checks the two configured distinct signatures (services/verifier/service.mjs:L69-L118; backend/protocol/signer.mjs:L16-L57; src/RunVerifier.sol:L81-L97).",
      "Settlement independently rechecks both publications and the replay, constructs submitScore calldata, and can later call settle. The contract, not the worker, ranks highest metres then lower entry ID and pays/rolls over (services/settlement/index.mjs:L195-L226; src/RunArcade.sol:L293-L354)."
    ]
  },
  "findings": [
    {
      "id": "VER-01",
      "severity": "critical",
      "priorFindingIds": ["F-02", "SR-02"],
      "title": "The assembled public permissionless relay endpoint is unreachable by its required HTTP method",
      "evidence": "services/main/application.mjs:L39-L50 permits only GET for /v1/settlement/*, while services/settlement/application.mjs:L44-L48 accepts /relay only on POST. Thus POST /v1/settlement/runs/<sessionId>/relay returns METHOD_NOT_ALLOWED before settlement.relay(). This was reproduced by static route tracing; no production endpoint was contacted.",
      "impact": "When the operator worker is delayed or unavailable, a player cannot use the advertised public relay route to obtain validated calldata. The contract remains permissionless only for callers who already possess both signatures/calldata.",
      "remedy": "Interface-preserving: change services/main/application.mjs so only POST with an empty body is also forwarded for the exact /v1/settlement/runs/<64-byte-session>/relay route; keep GET-only behavior for status/history routes. Add the integration assertion in test/integration/lifecycle.mjs that POST reaches createSettlementHandler, GET relay is rejected, and a malformed/nonempty request remains rejected.",
      "acceptance": "A composition-level test creates a validated fixture publication, POSTs the exact relay route through createApplication().api.handle(), receives calldata/status, and a separate funded fixture account successfully submits that calldata. Repeat after worker restart and with worker broadcast disabled."
    },
    {
      "id": "VER-02",
      "severity": "critical",
      "priorFindingIds": ["F-01", "F-02", "SR-01", "SR-02"],
      "title": "Two signatures constrain accidental single-key use but do not provide signer-independent availability or censorship resistance",
      "evidence": "RunArcade.submitScore requires signatures from immutable SCORE_AUTHORITY and REPLAY_VERIFIER (src/RunArcade.sol:L293-L321); RunVerifier only checks they are distinct addresses (src/RunVerifier.sol:L81-L97). Services split processes/configuration and reject visible combined signer settings (services/verifier/service.mjs:L25-L44; backend/protocol/signer.mjs:L48-L57), but no code can prove separate human/operator control. AttestationService returns incomplete/withheld/rejected statuses rather than a player-submittable proof when a role or witness is unavailable (services/verifier/service.mjs:L91-L118).",
      "impact": "A common controller of both keys can fabricate or censor a score; either unavailable/withholding role prevents a valid replay from reaching submitScore before the hard deadline. A quorum alone is therefore not a remedy.",
      "remedy": "No interface-preserving backend-only change can make the existing two-signature contract censorship-resistant. Minimum mitigation before any paid enablement: independent legal operators, KMS/HSM tenancy, cloud accounts, administrators, databases/backups, RPC providers and incident channels; mutually monitored public evidence/health/SLOs; and a public relay fixed by VER-01. Actual signer-independent payout needs a new immutable on-chain proof or independently available transcript/proof submission path in src/RunArcade.sol and src/RunVerifier.sol, followed by a new audit/deployment decision.",
      "acceptance": "Operational evidence must show neither operator can read, export, authorize or recover the other's signing material or witness database; a failover drill must keep one role unavailable while documenting that the present contract cannot accept the score. A future proof path must pass a test where both score signers are offline yet a valid player-held transcript reaches ScoreRecorded before close."
    },
    {
      "id": "VER-03",
      "severity": "high",
      "priorFindingIds": ["SR-03", "SR-04"],
      "title": "Replay validity is not proof of human play, and timing commitments do not bind observed arrival times",
      "evidence": "The targeted adversarial suite passed a frame-perfect real-time bot as a valid replay and separately showed differently timed witness arrivals produce identical terminal/replay commitments (test/audit-system/attacks/score-path.test.mjs:L53-L94). The independent verifier check ends with the same explicit limitation (services/verifier/check.mjs:L342).",
      "impact": "A bot with legal inputs, course information obtained from a compromised seed holder, or colluding runtime/witness infrastructure can produce a valid score. The system proves deterministic consistency and bounded timing only under witness trust; it does not eliminate bots or establish human play.",
      "remedy": "Do not claim bot elimination. Preserve the current replay checks; publish this residual risk and require anti-abuse policy/monitoring separately. For stronger timing evidence, design a player-exportable, independently replicated ordered log and explicitly specify its availability and trust assumptions; this is not a small interface-preserving patch.",
      "acceptance": "Keep the existing bot-accepted test as an expected residual test. Any anti-abuse proposal must define measurable false-positive/appeal rules and show that its evidence is not controlled by the runtime, witness, or either score signer."
    },
    {
      "id": "VER-04",
      "severity": "high",
      "priorFindingIds": ["SR-08", "CR-PROVIDER-TRUST", "CR-DEPLOYMENT-EVIDENCE"],
      "title": "SQLite durability mechanisms are implemented, but production durability, backup/restore and custody are unproven external dependencies",
      "evidence": "Witness, settlement and signer journals use WAL/FULL and IMMEDIATE transactions (services/verifier/witness.mjs:L18-L43; services/settlement/index.mjs:L41-L92; backend/store/score-reservations.mjs:L16-L46). Store schema constraints bind identity and score uniqueness. Conversely runtime documentation says protected storage must cover databases, WAL/journals, backups, swap and crash dumps and names production inputs as missing (backend/runtime/README.md:L24-L31,L76-L86); services/main/operator.mjs merely calls external infrastructure/custody/recovery peers.",
      "impact": "Local crash/restart tests do not establish recoverable, encrypted, independently administered production persistence. Lost or stale witness/reservation/outbox data can cause censorship, equivocation risk, inability to relay, or unsafe recovery. Provider quorum also retains common-mode trust.",
      "remedy": "Before paid enablement, provision separate encrypted persistent volumes for runtime/store, replay witness, each signer journal and settlement outbox; versioned encrypted backups; tested point-in-time restore/fencing; immutable retention for sealed replay pages; and documented reorg/recovery ownership. Add a deployment adapter acceptance harness around services/main/application.mjs plus restoration tests for backend/store, services/verifier and services/settlement.",
      "acceptance": "A staged drill kills each role at input ACK, terminal seal, KMS reservation, broadcast-before-ACK and reorg-recovery boundaries; restores independent backups into fenced replacements; verifies no second digest, no Royal re-grant, no replay loss, no duplicate relay, and no score from quarantined evidence."
    },
    {
      "id": "VER-05",
      "severity": "high",
      "priorFindingIds": ["CR-03", "Verifier L-4"],
      "title": "Hard close plus immutable signer addresses leaves no recovery path for signer loss or late verification",
      "evidence": "Scores are rejected at epoch end (src/RunArcade.sol:L303-L310), score expiry is deterministic at end-1 (services/verifier/replay.mjs:L37-L38), and the maximum checkpoint-to-close envelope is 300 seconds in the executed score-security experiment. The role addresses are constructor immutables (src/RunArcade.sol:L38-L47) with no rotation method.",
      "impact": "A healthy but delayed verifier, KMS, RPC, witness, relayer or block inclusion can exclude a valid score. Key compromise/loss cannot be repaired in-place; a new ledger deployment changes the domain and does not rescue existing-week claims.",
      "remedy": "Treat role-key loss and deadline capacity as paid-launch blockers. Require threshold/escrow custody procedures that retain the same configured address only if independently auditable, pre-close capacity and inclusion drills, and a documented incident policy. A post-close challenge period conflicts with immediate settlement and needs an explicit product/contract decision rather than silent backend relaxation.",
      "acceptance": "On a production-shaped test network, repeatedly run maximum-duration and concurrent terminal workloads through two independent RPCs/KMS/witnesses, inject one service outage and reorg, and show finalized ScoreRecorded inclusion with agreed residual margin. Record no result as passed if any role has no independently operated recovery procedure."
    },
    {
      "id": "VER-06",
      "severity": "blocker",
      "priorFindingIds": ["CR-DEPLOYMENT-EVIDENCE"],
      "title": "The pinned website and deployment configuration are intentionally closed; no live paid backend or contract identities are evidenced",
      "evidence": "Both pinned deployments/chain-1.json files set deployed contracts and role addresses to null; the pinned website's API meta tag is empty and paid buttons are disabled. No live chain or HTTPS probe was requested or run.",
      "impact": "There is no evidence-backed real paid-run trace, external persistence service, independent verifier operation, HTTPS endpoint, Etherscan verification, or deployment to assess. Free practice may be statically present, but it does not validate the paid trust path.",
      "remedy": "Keep paid play disabled. Do not substitute addresses or credentials. When supplied by the requester/operators, bind actual deployment, HTTPS API, role identities, independently operated witness/verifier/settlement services and approval evidence to a fresh audit scope.",
      "acceptance": "Read-only evidence collection verifies finalized chain-1 deployment receipts/code/immutables, public HTTPS health and relay behavior, role/operator separation attestations, encrypted backup restore drills, and a complete paid run without using a production signing key in tests."
    }
  ],
  "livenessAnalysis": {
    "normalPath": "After both role publications are verified, Settlement.relay independently validates evidence and exposes calldata; any funded caller can submit the resulting RunArcade.submitScore transaction, and anyone can call settle after close.",
    "apiFailure": "If the assembled API is unavailable, player access to evidence/relay fails. If it is available, VER-01 still blocks POST relay in the mounted application. Direct contract submission remains possible only if the caller already has both valid signatures and calldata.",
    "verifierOrWitnessFailure": "Exact blocker: AttestationService cannot create a required signature without its own witness/chain/runtime evidence and, for score authority, replay-verifier evidence. The contract has no permissionless evidence/proof/dispute submission route and no timeout substitute signer. A valid replay therefore cannot be forced to payout.",
    "disputePath": "backend/store has an internal openDispute() record (backend/store/index.mjs:L665-L672), but no inspected public player dispute route converts it into an on-chain score or payout. It is a hold mechanism, not a no-censorship path.",
    "conclusion": "Current code fails closed against invalid evidence but does not meet a signer-independent no-censorship/liveness property. The public relay bug is repairable without changing interfaces; unavailable or malicious signers require an explicit new protocol/contract decision."
  },
  "independentOperatorRequirements": [
    "Score authority and replay verifier must be controlled by separate organizations with separate beneficial/control administrators, KMS/HSM tenants, recovery procedures, databases/backups, deployment accounts, RPC providers and monitoring access; different addresses and hostnames alone are insufficient.",
    "The replay witness must be independently writable/retained, expose authenticated sealed evidence to both verifier and public relay, and have tested backup/restore/fencing. Runtime must not administer it.",
    "Each signer must retain its own durable reservation journal and make its public evidence endpoint available under a monitored SLO; journal restoration must be tested before any KMS call after failover.",
    "Settlement needs a separate funded relay key and independently operated RPC quorum; public relay must be reachable, rate-limited and capable of returning calldata without requiring wallet login.",
    "All independence and availability assertions require current operational evidence. None was found in the pinned revisions."
  ],
  "checks": [
    {
      "command": "node services/verifier/check.mjs",
      "outcome": "passed",
      "testCounts": "11/11 verifier checks",
      "coverage": "valid path; forged terminal/distance/seed/checkpoint/input; missing/substituted witness; accelerated/backdated/forked/rate-limited inputs; duplicate/conflicting signatures; entry/seed reorg; provider disagreement; authenticated transport; role isolation; maximum-length replay measurement",
      "limitations": "Synthetic keys, in-memory peer transport and fixture chain only; its output expressly says valid bots and colluding operators are not eliminated."
    },
    {
      "command": "node services/settlement/check.mjs",
      "outcome": "passed",
      "testCounts": "8 scenario groups reported; no individual TAP count emitted",
      "coverage": "permissionless relay/settlement, restart/lost ACK/replacement, ties, cutoff, censorship status, rollover, settlement race, reorg/quarantine and signer rejection",
      "limitations": "Simulated chain and shortened inputs; it did not exercise the mounted application route contradiction or a live RPC/HTTPS service."
    },
    {
      "command": "node backend/store/check.mjs && node backend/admission/check.mjs",
      "outcome": "passed",
      "testCounts": "15/15 store; 12/12 admission",
      "coverage": "migrations, constraints, concurrent score claims, crash persistence, replay corruption, ranking/reorg, custody and finality gates",
      "limitations": "Disposable SQLite and synthetic adapters; no actual volume encryption, backup restore or independent operator test."
    },
    {
      "command": "node --test test/audit-system/attacks/score-path.test.mjs test/audit-system/attacks/evm.test.mjs && node backend/runtime/check.mjs",
      "outcome": "passed",
      "testCounts": "10/10 targeted attack tests; runtime 23/23",
      "coverage": "forgery, cross-evidence mismatch, timing, withholding, valid bot, signer-journal equivocation, Royal recovery, crash/restart, witness conflict and cutoff behavior",
      "limitations": "EVM/chain fixtures; no live mainnet transaction or externally operated service."
    },
    {
      "command": "node -e \"import('./test/score-security/experiment.mjs').then(async m=>console.log(JSON.stringify(await m.experiment())))\"",
      "outcome": "passed",
      "testCounts": "8 replay vectors plus one evidence experiment",
      "coverage": "rejected forged distance/commitment/reorg/input/unsealed evidence/timing; observed 300-second final checkpoint-to-close envelope",
      "limitations": "The experiment reported paidEligible:false and explicitly is native validity only."
    },
    {
      "command": "node tools/test.mjs",
      "outcome": "not completed",
      "testCounts": "Partial output showed many passing tests, but the sandbox blocked a later 127.0.0.1 network access and the aggregate result was unavailable.",
      "coverage": "Not counted as a pass.",
      "limitations": "Sandbox local-network policy prevented completion; targeted offline checks above were run instead."
    }
  ],
  "nextWork": [
    {
      "boundedTask": "Repair and test the mounted public POST relay route without changing settlement calldata or contract interfaces.",
      "paths": ["services/main/application.mjs", "test/integration/lifecycle.mjs", "services/settlement/application.mjs"],
      "dependencies": ["existing settlement fixture sources", "no production credentials"],
      "acceptanceChecks": ["POST empty-body relay reaches handler", "GET status/history still work", "nonempty/malformed relay remains rejected", "returned calldata is accepted by a fixture RunArcade"]
    },
    {
      "boundedTask": "Produce deployment-specific independent-operator and durability evidence, including restore/fencing drills, without enabling paid play.",
      "paths": ["services/main/config.mjs", "services/main/operator.mjs", "backend/runtime/README.md", "services/verifier/README.md", "services/settlement/README.md"],
      "dependencies": ["requester/operator-supplied role identities, independently administered KMS/HSM and storage, two RPC providers, HTTPS endpoints, backup policy"],
      "acceptanceChecks": ["evidence maps each role/key/store/admin to a distinct operator", "restore drill preserves reservations and witness roots", "reorg recovery is fenced", "no test treats a local fixture as production evidence"]
    },
    {
      "boundedTask": "Make a product/contract decision on signer-independent score liveness; do not represent a quorum as resolution.",
      "paths": ["src/RunArcade.sol", "src/RunVerifier.sol", "services/verifier/replay.mjs", "services/settlement/index.mjs", "test/audit-system/attacks/score-path.test.mjs"],
      "dependencies": ["explicit approval for a new proof/transcript protocol and a new audit/deployment scope"],
      "acceptanceChecks": ["both score roles may be offline while a valid player-held proof reaches ScoreRecorded before close", "cross-chain/entry/wallet replay and reorg tests fail", "tie/rollover/economics/Royal behavior remains identical"]
    }
  ],
  "blockers": [
    {
      "blocker": "No deployed chain-1 addresses, role identities, API origin, RPC endpoints, HTTPS service identities, KMS/HSM custody evidence, backup evidence or approvals are present in the pinned configuration.",
      "neededFromRequesterOrOperators": "Actual deployment/service evidence only when a follow-on review is authorized; no placeholder is acceptable."
    },
    {
      "blocker": "The existing contract requires both signers and offers no evidence/proof fallback, so signer-unavailability censorship cannot be closed by backend configuration.",
      "neededFromRequesterOrOperators": "A product decision authorizing a new on-chain liveness mechanism, or explicit acceptance that such scores can miss payout."
    }
  ],
  "costs": {
    "observed": null,
    "proposed": null,
    "note": "No service was purchased or provisioned. The pinned sources contain no reliable current price or vendor commitment for the required independent infrastructure."
  }
}
