import { invalidV3Input, unavailableV3Read, V3_BYTES32 } from '../../_lib/http';
import { requireV3X402Release } from '../../x402/_lib/release';

export async function GET(
  _request: Request,
  context: { params: Promise<{ evidenceHash: string }> | { evidenceHash: string } },
): Promise<Response> {
  const closed = requireV3X402Release();
  if (closed) return closed;
  const { evidenceHash } = await context.params;
  if (!V3_BYTES32.test(evidenceHash)) return invalidV3Input('invalid_evidence_hash', 'Evidence hash must be bytes32');
  return unavailableV3Read({
    route: '/api/v3/evidence/:evidenceHash',
    resource: `/api/v3/evidence/${evidenceHash}`,
    disposition: 'degraded',
    readiness: 'deferred',
    code: 'v3_evidence_module_deferred',
    message: 'EvidenceRegistryV3 is explicitly outside the current bonds-only pilot scope',
  });
}
